Skip to content

Commit d8c95a8

Browse files
Update Benchmarks.md
1 parent 1d74e10 commit d8c95a8

File tree

1 file changed

+161
-0
lines changed

1 file changed

+161
-0
lines changed

Benchmarks.md

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,164 @@ ______
328328
______
329329

330330
# List
331+
332+
### Primitive types:
333+
Queue elements are primitives: `byte`, `float`, `int`, `short`, `decimal`... .
334+
| Method | Size | Mean | Ratio | Allocated |
335+
|--------------------------- |-------- |---------------:|------:|----------:|
336+
| **StackMemoryCollections** | **100** | **402.2 ns** | **0.95** | **400 B** |
337+
| System.Collections.Generic | 100 | 423.3 ns | 1.00 | 456 B |
338+
| | | | | |
339+
| **StackMemoryCollections** | **1000** | **3,325.0 ns** | **0.82** | **4000 B** |
340+
| System.Collections.Generic | 1000 | 4,070.2 ns | 1.00 | 4056 B |
341+
| | | | | |
342+
| **StackMemoryCollections** | **10000** | **32,585.5 ns** | **0.81** | **40000 B** |
343+
| System.Collections.Generic | 10000 | 40,326.4 ns | 1.00 | 40056 B |
344+
| | | | | |
345+
| **StackMemoryCollections** | **100000** | **402,172.2 ns** | **0.78** | **400000 B** |
346+
| System.Collections.Generic | 100000 | 510,568.8 ns | 1.00 | 400098 B |
347+
| | | | | |
348+
| **StackMemoryCollections** | **250000** | **1,306,561.9 ns** | **1.03** | **1000001 B** |
349+
| System.Collections.Generic | 250000 | 1,294,331.1 ns | 1.00 | 1000140 B |
350+
| | | | | |
351+
| **StackMemoryCollections** | **500000** | **2,229,919.5 ns** | **0.88** | **2000002 B** |
352+
| System.Collections.Generic | 500000 | 2,502,543.0 ns | 1.00 | 2000225 B |
353+
| | | | | |
354+
| **StackMemoryCollections** | **1000000** | **4,793,840.6 ns** | **0.95** | **4000004 B** |
355+
| System.Collections.Generic | 1000000 | 5,005,536.2 ns | 1.00 | 4000393 B |
356+
[Code](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Src/Benchmarks/List/Simple/PrimitiveSimpleJob.cs)
357+
______
358+
359+
| Method | Size | Mean | Ratio | Allocated |
360+
|--------------------------- |-------- |--------------:|------:|------------:|
361+
| **StackMemoryCollections** | **100** | **50.24 μs** | **0.82** | **400 B** |
362+
| System.Collections.Generic | 100 | 61.50 μs | 1.00 | 91200 B |
363+
| | | | | |
364+
| **StackMemoryCollections** | **1000** | **472.60 μs** | **0.80** | **4000 B** |
365+
| System.Collections.Generic | 1000 | 589.54 μs | 1.00 | 811200 B |
366+
| | | | | |
367+
| **StackMemoryCollections** | **10000** | **4,699.71 μs** | **0.83** | **40004 B** |
368+
| System.Collections.Generic | 10000 | 5,680.55 μs | 1.00 | 8011204 B |
369+
| | | | | |
370+
| **StackMemoryCollections** | **100000** | **47,089.39 μs** | **0.60** | **400044 B** |
371+
| System.Collections.Generic | 100000 | 78,663.28 μs | 1.00 | 80020059 B |
372+
| | | | | |
373+
| **StackMemoryCollections** | **250000** | **121,598.15 μs** | **0.62** | **1000096 B** |
374+
| System.Collections.Generic | 250000 | 196,329.26 μs | 1.00 | 200029072 B |
375+
| | | | | |
376+
| **StackMemoryCollections** | **500000** | **236,688.60 μs** | **0.63** | **2000160 B** |
377+
| System.Collections.Generic | 500000 | 378,948.09 μs | 1.00 | 400048032 B |
378+
| | | | | |
379+
| **StackMemoryCollections** | **1000000** | **471,179.85 μs** | **0.61** | **4002224 B** |
380+
| System.Collections.Generic | 1000000 | 771,659.38 μs | 1.00 | 800080336 B |
381+
382+
[Code](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Src/Benchmarks/List/Optimal/PrimitiveOptimalJob.cs)
383+
______
384+
### Class:
385+
Queue elements are classes.
386+
| Method | Size | Mean | Ratio | Allocated |
387+
|--------------------------- |-------- |---------------:|------:|-----------:|
388+
| **StackMemoryCollections** | **100** | **1.035 μs** | **0.75** | **2400 B** |
389+
| System.Collections.Generic | 100 | 1.372 μs | 1.00 | 8056 B |
390+
| | | | | |
391+
| **StackMemoryCollections** | **1000** | **10.238 μs** | **0.76** | **24000 B** |
392+
| System.Collections.Generic | 1000 | 13.558 μs | 1.00 | 80056 B |
393+
| | | | | |
394+
| **StackMemoryCollections** | **10000** | **108.900 μs** | **0.75** | **240000 B** |
395+
| System.Collections.Generic | 10000 | 144.636 μs | 1.00 | 800056 B |
396+
| | | | | |
397+
| **StackMemoryCollections** | **100000** | **1,315.957 μs** | **0.30** | **2400001 B** |
398+
| System.Collections.Generic | 100000 | 4,130.503 μs | 1.00 | 8000141 B |
399+
| | | | | |
400+
| **StackMemoryCollections** | **250000** | **3,348.137 μs** | **0.19** | **6000002 B** |
401+
| System.Collections.Generic | 250000 | 17,567.766 μs | 1.00 | 20000287 B |
402+
| | | | | |
403+
| **StackMemoryCollections** | **500000** | **6,687.458 μs** | **0.11** | **12000004 B** |
404+
| System.Collections.Generic | 500000 | 57,512.715 μs | 1.00 | 40000670 B |
405+
| | | | | |
406+
| **StackMemoryCollections** | **1000000** | **13,881.078 μs** | **0.09** | **24000008 B** |
407+
| System.Collections.Generic | 1000000 | 147,485.595 μs | 1.00 | 80000794 B |
408+
409+
[Code](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Src/Benchmarks/List/Simple/ClassSimpleJob.cs)
410+
______
411+
412+
| Method | Size | Mean | Ratio | Allocated |
413+
|--------------------------- |-------- |-----------------:|------:|--------------:|
414+
| **StackMemoryCollections** | **100** | **60.16 μs** | **0.26** | **2400 B** |
415+
| System.Collections.Generic | 100 | 233.90 μs | 1.00 | 1611200 B |
416+
| | | | | |
417+
| **StackMemoryCollections** | **1000** | **581.30 μs** | **0.25** | **24001 B** |
418+
| System.Collections.Generic | 1000 | 2,312.54 μs | 1.00 | 16011202 B |
419+
| | | | | |
420+
| **StackMemoryCollections** | **10000** | **5,866.07 μs** | **0.23** | **240004 B** |
421+
| System.Collections.Generic | 10000 | 25,280.37 μs | 1.00 | 160011216 B |
422+
| | | | | |
423+
| **StackMemoryCollections** | **100000** | **62,648.67 μs** | **0.08** | **2400053 B** |
424+
| System.Collections.Generic | 100000 | 826,362.25 μs | 1.00 | 1600028144 B |
425+
| | | | | |
426+
| **StackMemoryCollections** | **250000** | **155,187.57 μs** | **0.04** | **6000120 B** |
427+
| System.Collections.Generic | 250000 | 4,179,162.18 μs | 1.00 | 4000058448 B |
428+
| | | | | |
429+
| **StackMemoryCollections** | **500000** | **313,635.15 μs** | **0.03** | **12000240 B** |
430+
| System.Collections.Generic | 500000 | 11,768,582.86 μs | 1.00 | 8000133056 B |
431+
| | | | | |
432+
| **StackMemoryCollections** | **1000000** | **679,751.59 μs** | **0.02** | **24001072 B** |
433+
| System.Collections.Generic | 1000000 | 31,926,569.52 μs | 1.00 | 16000120936 B |
434+
435+
[Code](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Src/Benchmarks/List/Optimal/ClassOptimalJob.cs)
436+
______
437+
### Struct:
438+
Queue elements are structures.
439+
440+
| Method | Size | Mean | Ratio | Allocated |
441+
|--------------------------- |-------- |----------------:|------:|-----------:|
442+
| **StackMemoryCollections** | **100** | **549.4 ns** | **0.47** | **2400 B** |
443+
| System.Collections.Generic | 100 | 1,166.5 ns | 1.00 | 3256 B |
444+
| | | | | |
445+
| **StackMemoryCollections** | **1000** | **4,861.2 ns** | **0.42** | **24000 B** |
446+
| System.Collections.Generic | 1000 | 11,453.0 ns | 1.00 | 32056 B |
447+
| | | | | |
448+
| **StackMemoryCollections** | **10000** | **57,908.7 ns** | **0.30** | **240000 B** |
449+
| System.Collections.Generic | 10000 | 194,387.6 ns | 1.00 | 320090 B |
450+
| | | | | |
451+
| **StackMemoryCollections** | **100000** | **1,005,552.5 ns** | **0.56** | **2400000 B** |
452+
| System.Collections.Generic | 100000 | 1,947,173.5 ns | 1.00 | 3200392 B |
453+
| | | | | |
454+
| **StackMemoryCollections** | **250000** | **2,377,210.4 ns** | **0.59** | **6000002 B** |
455+
| System.Collections.Generic | 250000 | 3,912,643.2 ns | 1.00 | 8000148 B |
456+
| | | | | |
457+
| **StackMemoryCollections** | **500000** | **4,819,554.6 ns** | **0.67** | **12000004 B** |
458+
| System.Collections.Generic | 500000 | 7,602,517.4 ns | 1.00 | 16000156 B |
459+
| | | | | |
460+
| **StackMemoryCollections** | **1000000** | **10,078,648.6 ns** | **0.53** | **24000008 B** |
461+
| System.Collections.Generic | 1000000 | 19,866,444.6 ns | 1.00 | 32000396 B |
462+
463+
[Code](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Src/Benchmarks/List/Simple/StructSimpleJob.cs)
464+
______
465+
466+
| Method | Size | Mean | Ratio | Allocated |
467+
|--------------------------- |-------- |----------------:|------:|-------------:|
468+
| **StackOfJobStruct** | **100** | **64.24 μs** | **0.30** | **2400 B** |
469+
| System.Collections.Generic | 100 | 211.24 μs | 1.00 | 651200 B |
470+
| | | | | |
471+
| **StackOfJobStruct** | **1000** | **618.33 μs** | **0.31** | **24000 B** |
472+
| System.Collections.Generic | 1000 | 2,026.44 μs | 1.00 | 6411202 B |
473+
| | | | | |
474+
| **StackOfJobStruct** | **10000** | **6,226.81 μs** | **0.17** | **240004 B** |
475+
| System.Collections.Generic | 10000 | 36,371.81 μs | 1.00 | 64017930 B |
476+
| | | | | |
477+
| **StackOfJobStruct** | **100000** | **64,389.84 μs** | **0.18** | **2400053 B** |
478+
| System.Collections.Generic | 100000 | 354,953.00 μs | 1.00 | 640080288 B |
479+
| | | | | |
480+
| **StackOfJobStruct** | **250000** | **160,951.43 μs** | **0.22** | **6000120 B** |
481+
| System.Collections.Generic | 250000 | 729,754.85 μs | 1.00 | 1600030992 B |
482+
| | | | | |
483+
| **StackOfJobStruct** | **500000** | **325,906.75 μs** | **0.24** | **12000240 B** |
484+
| System.Collections.Generic | 500000 | 1,394,296.83 μs | 1.00 | 3200034424 B |
485+
| | | | | |
486+
| **StackOfJobStruct** | **1000000** | **660,610.88 μs** | **0.18** | **24000720 B** |
487+
| System.Collections.Generic | 1000000 | 3,696,655.42 μs | 1.00 | 6400080288 B |
488+
489+
[Code](https://github.com/SoftStoneDevelop/StackMemoryCollections/blob/main/Src/Benchmarks/List/Optimal/StructOptimalJob.cs)
490+
491+
______

0 commit comments

Comments
 (0)