File tree Expand file tree Collapse file tree 3 files changed +10
-20
lines changed
Src/Benchmarks/List/Optimal Expand file tree Collapse file tree 3 files changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -18,21 +18,19 @@ public void StackMemory()
1818 {
1919 using ( var memory = new StackMemoryCollections . Struct . StackMemory ( JobClassHelper . SizeOf * ( nuint ) Size ) )
2020 {
21- var item = new Benchmark . Struct . JobClassWrapper ( memory . Start , false ) ;
22- var js2W = new Benchmark . Struct . JobClass2Wrapper ( memory . Start , false ) ;
21+ using var item = new Benchmark . Struct . JobClassWrapper ( ) ;
22+ var js2W = new Benchmark . Struct . JobClass2Wrapper ( item . JobClass2Ptr , false ) ;
2323 for ( int j = 0 ; j < 100 ; j ++ )
2424 {
2525 {
2626 using var list = new Benchmark . Struct . ListOfJobClass ( 5 , & memory ) ;
2727 for ( int i = 0 ; i < Size / 2 ; i ++ )
2828 {
29- item . ChangePtr ( list . GetFuture ( ) ) ;
3029 item . SetInt32 ( in i ) ;
3130 item . SetInt64 ( i * 2 ) ;
32- js2W . ChangePtr ( item . JobClass2Ptr ) ;
3331 js2W . SetInt32 ( 15 ) ;
3432 js2W . SetInt64 ( 36 ) ;
35- list . AddFuture ( ) ;
33+ list . Add ( item . Ptr ) ;
3634 }
3735
3836 if ( j > 50 )
@@ -52,13 +50,11 @@ public void StackMemory()
5250 using var list2 = new Benchmark . Struct . ListOfJobClass ( ( nuint ) Size , & memory ) ;
5351 for ( int i = 0 ; i < Size ; i ++ )
5452 {
55- item . ChangePtr ( list2 . GetFuture ( ) ) ;
5653 item . SetInt32 ( in i ) ;
5754 item . SetInt64 ( i * 2 ) ;
58- js2W . ChangePtr ( item . JobClass2Ptr ) ;
5955 js2W . SetInt32 ( 15 ) ;
6056 js2W . SetInt64 ( 36 ) ;
61- list2 . AddFuture ( ) ;
57+ list2 . Add ( item . Ptr ) ;
6258 }
6359
6460 if ( j > 50 )
Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ public void StackMemory()
2424 using var list = new StackMemoryCollections . Struct . ListOfInt32 ( 5 , & memory ) ;
2525 for ( int i = 0 ; i < Size / 2 ; i ++ )
2626 {
27- * list . GetFuture ( ) = i;
28- list . AddFuture ( ) ;
27+ list . Add ( in i ) ;
2928 }
3029
3130 if ( j > 50 )
@@ -45,8 +44,7 @@ public void StackMemory()
4544 using var list2 = new StackMemoryCollections . Struct . ListOfInt32 ( ( nuint ) Size , & memory ) ;
4645 for ( int i = 0 ; i < Size ; i ++ )
4746 {
48- * list2 . GetFuture ( ) = i;
49- list2 . AddFuture ( ) ;
47+ list2 . Add ( in i ) ;
5048 }
5149
5250 if ( j > 50 )
Original file line number Diff line number Diff line change @@ -18,21 +18,19 @@ public void StackMemory()
1818 {
1919 using ( var memory = new StackMemoryCollections . Struct . StackMemory ( JobStructHelper . SizeOf * ( nuint ) Size ) )
2020 {
21- var item = new Benchmark . Struct . JobStructWrapper ( memory . Start , false ) ;
22- var js2W = new Benchmark . Struct . JobStruct2Wrapper ( memory . Start , false ) ;
21+ using var item = new Benchmark . Struct . JobStructWrapper ( ) ;
22+ var js2W = new Benchmark . Struct . JobStruct2Wrapper ( item . JobStruct2Ptr , false ) ;
2323 for ( int j = 0 ; j < 100 ; j ++ )
2424 {
2525 {
2626 using var list = new Benchmark . Struct . ListOfJobStruct ( 5 , & memory ) ;
2727 for ( int i = 0 ; i < Size / 2 ; i ++ )
2828 {
29- item . ChangePtr ( list . GetFuture ( ) ) ;
3029 item . SetInt32 ( in i ) ;
3130 item . SetInt64 ( i * 2 ) ;
32- js2W . ChangePtr ( item . JobStruct2Ptr ) ;
3331 js2W . SetInt32 ( 15 ) ;
3432 js2W . SetInt64 ( 36 ) ;
35- list . AddFuture ( ) ;
33+ list . Add ( item . Ptr ) ;
3634 }
3735
3836 if ( j > 50 )
@@ -52,13 +50,11 @@ public void StackMemory()
5250 using var list2 = new Benchmark . Struct . ListOfJobStruct ( ( nuint ) Size , & memory ) ;
5351 for ( int i = 0 ; i < Size ; i ++ )
5452 {
55- item . ChangePtr ( list2 . GetFuture ( ) ) ;
5653 item . SetInt32 ( in i ) ;
5754 item . SetInt64 ( i * 2 ) ;
58- js2W . ChangePtr ( item . JobStruct2Ptr ) ;
5955 js2W . SetInt32 ( 15 ) ;
6056 js2W . SetInt64 ( 36 ) ;
61- list2 . AddFuture ( ) ;
57+ list2 . Add ( item . Ptr ) ;
6258 }
6359
6460 if ( j > 50 )
You can’t perform that action at this time.
0 commit comments