File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
jemalloc.Benchmarks/Benchmarks Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public void CreateManagedArray()
3434 public void CreateNativeArray ( )
3535 {
3636 SafeArray < T > array = new SafeArray < T > ( ArraySize ) ;
37+ array . Release ( ) ;
3738 }
3839
3940 [ Benchmark ( Description = "Fill a managed array with a single value." ) ]
@@ -75,6 +76,26 @@ public void ArithmeticMultiplyNativeArray()
7576 T r = nativeArray [ ArraySize / 2 ] ;
7677 }
7778
79+ [ Benchmark ( Description = "Fill all values of a managed array with a single value and then compute the square root." ) ]
80+ [ BenchmarkCategory ( "Arithmetic" ) ]
81+ public void ArithmeticSqrtManagedArray ( )
82+ {
83+ for ( int i = 0 ; i < managedArray . Length ; i ++ )
84+ {
85+ managedArray [ i ] = JemUtil . ValToGenericStruct < uint , T > ( 256u ) ;
86+ JemUtil . GenericSqrt ( managedArray [ i ] ) ;
87+ }
88+ }
89+
90+ [ Benchmark ( Description = "Fill all values of a native array with a single value and then compute the square root." ) ]
91+ [ BenchmarkCategory ( "Arithmetic" ) ]
92+ public void ArithmeticSqrtNativeArray ( )
93+ {
94+ nativeArray . Fill ( JemUtil . ValToGenericStruct < uint , T > ( 256u ) ) ;
95+ nativeArray . VectorSqrt ( ) ;
96+ }
97+
98+
7899 protected T [ ] managedArray ;
79100 protected SafeArray < T > nativeArray ;
80101 protected T fill ;
Original file line number Diff line number Diff line change 11@ echo off
2- set OLDPATH = %PATH%
3- set PATH = %PATH% ;%cd% \x64\Debug
42dotnet .\x64\Release\netcoreapp2.0\jemalloc.Cli.dll %*
5- set PATH = %OLDPATH%
63:end
You can’t perform that action at this time.
0 commit comments