# Performance Comparison: Containers
> **This file is auto-generated**
>
> All measurments were taken on Intel(R) Core(TM) i9-9900KS CPU @ 4.00GHz with 16 logical cores.
> Unity Editor version: 2022.3.6f1
> To regenerate this file locally use: **DOTS -> Unity.Collections -> Generate ***** menu.
## Table of Contents
- [Benchmark Results](#benchmark-results)
- [HashMap](#hashmap)
- [HashSet](#hashset)
- [List](#list)
- [ParallelHashMap](#parallelhashmap)
- [ParallelHashSet](#parallelhashset)
- [QueueParallelWriter](#queueparallelwriter)
- [Queue](#queue)
- [RingQueue](#ringqueue)
## Benchmark Results
The **Median of 10 sample sets** is compared against the baseline on the far right side of the table.
Multithreaded benchmarks divide the processing amongst the specified number of workers.
5 extra sample sets are run as warmup.
> **Legend**
>
> `(S)` = Safety Enabled
> `(B)` = Burst Compiled *with Safety Disabled*
> `(S+B)` = Burst Compiled *with Safety Enabled*
> `(BCL)` = Base Class Library implementation (such as provided by Mono or .NET)
>
> *`italic`* results are for benchmarking comparison only; these are not included in standard Performance Framework tests
### *HashMap*
| Functionality | NativeHashMap (S) | NativeHashMap (S+B) | NativeHashMap (B) | UnsafeHashMap (S) | UnsafeHashMap (S+B) | UnsafeHashMap (B) | *Dictionary (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(0)`*ΒΉ* | 0.342ms (0.4x) π | 0.111ms (1.1x) | 0.133ms (0.9x) | 0.221ms (0.5x) | 0.105ms (1.1x) π’ | 0.106ms (1.1x) | *0.120ms (1.0x)* |
| `IsEmpty_x_100k(100)`*ΒΉ* | 0.342ms (0.4x) π | 0.112ms (1.1x) | 0.133ms (0.9x) | 0.221ms (0.5x) | 0.106ms (1.1x) | 0.106ms (1.1x) π’ | *0.120ms (1.0x)* |
| `Count_x_100k(0)`*ΒΉ* | 0.261ms (0.5x) π | 0.142ms (0.8x) | 0.108ms (1.1x) π’ | 0.120ms (1.0x) | 0.111ms (1.1x) | 0.111ms (1.1x) | *0.120ms (1.0x)* |
| `Count_x_100k(100)`*ΒΉ* | 0.261ms (0.5x) π | 0.142ms (0.8x) | 0.111ms (1.1x) π’ | 0.120ms (1.0x) | 0.111ms (1.1x) | 0.111ms (1.1x) | *0.120ms (1.0x)* |
| `ToNativeArrayKeys(10000)` | 0.151ms (0.1x) | 0.126ms (0.1x) | 0.092ms (0.2x) | 0.159ms (0.1x) π | 0.125ms (0.1x) | 0.083ms (0.2x) | *0.018ms (1.0x)* π’ |
| `ToNativeArrayKeys(100000)` | 1.659ms (0.1x) π | 1.214ms (0.1x) | 0.918ms (0.2x) | 1.610ms (0.1x) | 1.205ms (0.1x) | 0.908ms (0.2x) | *0.174ms (1.0x)* π’ |
| `ToNativeArrayKeys(1000000)` | 21.689ms (0.1x) π | 13.624ms (0.2x) | 10.721ms (0.2x) | 19.842ms (0.1x) | 13.505ms (0.2x) | 10.569ms (0.2x) | *2.059ms (1.0x)* π’ |
| `ToNativeArrayValues(10000)` | 0.160ms (0.1x) | 0.118ms (0.2x) | 0.086ms (0.2x) | 0.161ms (0.1x) π | 0.125ms (0.1x) | 0.084ms (0.2x) | *0.018ms (1.0x)* π’ |
| `ToNativeArrayValues(100000)` | 1.702ms (0.1x) | 1.192ms (0.1x) | 0.935ms (0.2x) | 1.721ms (0.1x) π | 1.196ms (0.1x) | 0.919ms (0.2x) | *0.173ms (1.0x)* π’ |
| `ToNativeArrayValues(1000000)` | 20.402ms (0.1x) | 13.609ms (0.1x) | 11.017ms (0.2x) | 20.556ms (0.1x) π | 13.773ms (0.1x) | 10.869ms (0.2x) | *2.018ms (1.0x)* π’ |
| `Insert(10000)` | 0.135ms (1.3x) | 0.070ms (2.5x) | 0.061ms (2.9x) | 0.120ms (1.5x) | 0.060ms (2.9x) π’ | 0.061ms (2.9x) | *0.175ms (1.0x)* π |
| `Insert(100000)` | 1.723ms (1.3x) | 0.996ms (2.2x) | 0.914ms (2.4x) | 1.565ms (1.4x) | 0.909ms (2.4x) | 0.889ms (2.5x) π’ | *2.209ms (1.0x)* π |
| `Insert(1000000)` | 33.017ms (0.9x) | 21.056ms (1.4x) | 19.847ms (1.5x) | 50.228ms (0.6x) π | 19.654ms (1.5x) | 19.613ms (1.5x) π’ | *29.738ms (1.0x)* |
| `AddGrow(4, 1048576)`*Β³* | 137.459ms (0.4x) π | 81.364ms (0.6x) | 77.039ms (0.6x) | 133.603ms (0.4x) | 78.458ms (0.6x) | 76.533ms (0.6x) | *49.222ms (1.0x)* π’ |
| `AddGrow(65536, 1048576)`*Β³* | 140.883ms (0.4x) π | 82.611ms (0.6x) | 77.670ms (0.6x) | 134.717ms (0.4x) | 79.913ms (0.6x) | 77.316ms (0.6x) | *50.215ms (1.0x)* π’ |
| `Contains(10000)` | 0.089ms (2.1x) | 0.036ms (5.1x) | 0.027ms (6.8x) | 0.101ms (1.9x) | 0.029ms (6.4x) | 0.025ms (7.4x) π’ | *0.188ms (1.0x)* π |
| `Contains(100000)` | 1.696ms (1.7x) | 0.694ms (4.1x) | 0.508ms (5.6x) | 1.945ms (1.5x) | 0.538ms (5.3x) | 0.482ms (5.9x) π’ | *2.843ms (1.0x)* π |
| `Contains(1000000)` | 42.805ms (1.5x) | 17.135ms (3.6x) | 12.633ms (4.9x) | 43.284ms (1.4x) | 12.700ms (4.9x) | 11.703ms (5.3x) π’ | *62.072ms (1.0x)* π |
| `IndexedRead(10000)` | 0.109ms (1.7x) | 0.028ms (6.7x) | 0.032ms (5.9x) | 0.122ms (1.6x) | 0.027ms (7.1x) | 0.026ms (7.1x) π’ | *0.189ms (1.0x)* π |
| `IndexedRead(100000)` | 1.983ms (1.4x) | 0.592ms (4.7x) | 0.614ms (4.5x) | 2.125ms (1.3x) | 0.543ms (5.1x) π’ | 0.545ms (5.1x) | *2.791ms (1.0x)* π |
| `IndexedRead(1000000)` | 57.739ms (1.1x) | 16.881ms (3.7x) | 16.937ms (3.7x) | 57.860ms (1.1x) | 14.918ms (4.1x) π’ | 15.113ms (4.1x) | *61.850ms (1.0x)* π |
| `IndexedWrite(10000)` | 0.103ms (2.0x) | 0.080ms (2.6x) | 0.040ms (5.2x) | 0.084ms (2.5x) | 0.039ms (5.3x) | 0.036ms (5.8x) π’ | *0.209ms (1.0x)* π |
| `IndexedWrite(100000)` | 1.890ms (1.6x) | 1.269ms (2.4x) | 0.755ms (4.1x) | 1.473ms (2.1x) | 0.759ms (4.1x) | 0.707ms (4.3x) π’ | *3.074ms (1.0x)* π |
| `IndexedWrite(1000000)` | 73.370ms (1.0x) | 69.054ms (1.1x) | 65.695ms (1.1x) π’ | 73.500ms (1.0x) | 65.870ms (1.1x) | 66.574ms (1.1x) | *73.729ms (1.0x)* π |
| `TryGetValue(10000)` | 0.105ms (1.8x) | 0.033ms (5.7x) | 0.032ms (5.9x) | 0.120ms (1.6x) | 0.029ms (6.6x) π’ | 0.029ms (6.6x) π’ | *0.191ms (1.0x)* π |
| `TryGetValue(100000)` | 1.943ms (1.4x) | 0.645ms (4.4x) | 0.637ms (4.4x) | 2.102ms (1.3x) | 0.574ms (4.9x) | 0.557ms (5.1x) π’ | *2.816ms (1.0x)* π |
| `TryGetValue(1000000)` | 55.056ms (1.1x) | 18.084ms (3.4x) | 17.878ms (3.5x) | 59.138ms (1.0x) | 15.889ms (3.9x) | 15.692ms (4.0x) π’ | *62.067ms (1.0x)* π |
| `Remove(10000)` | 0.110ms (1.4x) | 0.044ms (3.6x) | 0.035ms (4.5x) | 0.094ms (1.7x) | 0.029ms (5.4x) | 0.028ms (5.6x) π’ | *0.158ms (1.0x)* π |
| `Remove(100000)` | 1.889ms (1.3x) | 0.844ms (2.8x) | 0.661ms (3.6x) | 3.654ms (0.7x) π | 0.566ms (4.2x) | 0.547ms (4.4x) π’ | *2.395ms (1.0x)* |
| `Remove(1000000)` | 62.623ms (1.0x) | 56.372ms (1.1x) | 53.877ms (1.2x) π’ | 61.104ms (1.0x) | 54.841ms (1.1x) | 55.805ms (1.1x) | *62.915ms (1.0x)* π |
| `Foreach(10000)` | 0.150ms (0.3x) π | 0.083ms (0.5x) | 0.077ms (0.5x) | 0.141ms (0.3x) | 0.077ms (0.5x) | 0.079ms (0.5x) | *0.041ms (1.0x)* π’ |
| `Foreach(100000)` | 1.984ms (0.2x) π | 0.924ms (0.4x) | 0.866ms (0.5x) | 1.869ms (0.2x) | 0.865ms (0.5x) | 0.885ms (0.5x) | *0.412ms (1.0x)* π’ |
| `Foreach(1000000)` | 27.605ms (0.2x) π | 10.947ms (0.4x) | 10.421ms (0.4x) | 26.351ms (0.2x) | 10.457ms (0.4x) | 10.619ms (0.4x) | *4.359ms (1.0x)* π’ |
*ΒΉ* Optimizations were disabled to perform this benchmark
*Β³* AddGrow(capacity, growTo) -- Incrementally grows from `capacity` until reaching size of `growTo`
---
### *HashSet*
| Functionality | NativeHashSet (S) | NativeHashSet (S+B) | NativeHashSet (B) | UnsafeHashSet (S) | UnsafeHashSet (S+B) | UnsafeHashSet (B) | *HashSet (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(0)`*ΒΉ* | 0.342ms (0.4x) π | 0.112ms (1.3x) | 0.133ms β(1.1x) | 0.221ms (0.6x) | 0.106ms (1.3x) π’ | 0.106ms β(1.3x) | *0.140ms (1.0x)* |
| `IsEmpty_x_100k(100)`*ΒΉ* | 0.342ms (0.4x) π | 0.112ms (1.3x) | 0.133ms β(1.1x) | 0.221ms (0.6x) | 0.106ms (1.3x) | 0.106ms β(1.3x) π’ | *0.140ms (1.0x)* |
| `Count_x_100k(0)`*ΒΉ* | 0.261ms (0.5x) π | 0.143ms (1.0x) | 0.111ms β(1.3x) | 0.100ms (1.4x) π’ | 0.111ms (1.3x) | 0.108ms β(1.3x) | *0.140ms (1.0x)* |
| `Count_x_100k(100)`*ΒΉ* | 0.261ms (0.5x) π | 0.142ms (1.0x) | 0.111ms β(1.3x) | 0.100ms (1.4x) π’ | 0.111ms (1.3x) | 0.111ms β(1.3x) | *0.140ms (1.0x)* |
| `ToNativeArray(10000)` | 0.043ms (0.4x) π | 0.015ms (1.2x) | 0.009ms β(1.9x) | 0.043ms (0.4x) | 0.015ms (1.2x) | 0.009ms β(1.9x) π’ | *0.018ms (1.0x)* |
| `ToNativeArray(100000)` | 0.475ms (0.4x) | 0.144ms (1.2x) | 0.085ms β(2.1x) π’ | 0.485ms (0.4x) π | 0.144ms (1.2x) | 0.085ms β(2.1x) π’ | *0.176ms (1.0x)* |
| `ToNativeArray(1000000)` | 4.935ms (0.4x) | 1.591ms (1.2x) | 0.989ms β(1.9x) π’ | 5.378ms (0.4x) π | 1.586ms (1.2x) | 0.997ms β(1.9x) | *1.927ms (1.0x)* |
| `Insert(10000)` | 0.093ms (1.1x) | 0.044ms (2.3x) | 0.040ms β(2.6x) | 0.078ms (1.3x) | 0.039ms (2.6x) | 0.035ms β(2.9x) π’ | *0.103ms (1.0x)* π |
| `Insert(100000)` | 0.937ms (1.1x) | 0.441ms (2.3x) | 0.403ms β(2.6x) | 0.785ms (1.3x) | 0.390ms (2.6x) | 0.351ms β(2.9x) π’ | *1.029ms (1.0x)* π |
| `Insert(1000000)` | 12.275ms (0.8x) π | 7.030ms (1.5x) | 6.650ms β(1.6x) π’ | 10.495ms (1.0x) | 6.902ms (1.5x) | 6.747ms β(1.5x) | *10.384ms (1.0x)* |
| `AddGrow(4, 1048576)`*Β³* | 76.515ms (0.3x) π | 35.430ms (0.6x) | 33.171ms β(0.6x) | 75.704ms (0.3x) | 32.776ms (0.6x) | 30.928ms β(0.7x) | *20.387ms (1.0x)* π’ |
| `AddGrow(65536, 1048576)`*Β³* | 75.192ms (0.3x) π | 34.149ms (0.6x) | 32.652ms β(0.6x) | 74.248ms (0.3x) | 34.092ms (0.6x) | 32.440ms β(0.6x) | *19.978ms (1.0x)* π’ |
| `Contains(10000)` | 0.061ms (1.8x) | 0.017ms (6.7x) | 0.010ms (11.5x) | 0.072ms (1.6x) | 0.013ms (8.9x) | 0.009ms (12.5x) π’ | *0.113ms (1.0x)* π |
| `Contains(100000)` | 0.949ms (1.7x) | 0.311ms (5.2x) | 0.199ms β(8.1x) | 1.104ms (1.5x) | 0.207ms (7.8x) | 0.180ms β(8.9x) π’ | *1.610ms (1.0x)* π |
| `Contains(1000000)` | 11.436ms (1.7x) | 3.877ms (4.9x) | 2.576ms β(7.4x) | 13.252ms (1.4x) | 2.653ms (7.2x) | 2.373ms β(8.0x) π’ | *19.089ms (1.0x)* π |
| `Remove(10000)` | 0.111ms (1.7x) | 0.054ms (3.4x) | 0.044ms β(4.3x) | 0.101ms (1.8x) | 0.036ms (5.2x) π’ | 0.040ms β(4.6x) | *0.186ms (1.0x)* π |
| `Remove(100000)` | 1.327ms (1.6x) | 0.645ms (3.2x) | 0.531ms β(3.9x) | 1.218ms (1.7x) | 0.438ms (4.7x) π’ | 0.477ms β(4.4x) | *2.076ms (1.0x)* π |
| `Remove(1000000)` | 15.132ms (1.5x) | 7.264ms (3.2x) | 5.953ms β(3.9x) | 26.197ms (0.9x) π | 4.917ms (4.7x) π’ | 5.268ms β(4.4x) | *23.150ms (1.0x)* |
| `Foreach(10000)` | 0.081ms (0.4x) π | 0.029ms (1.2x) | 0.016ms β(2.3x) π’ | 0.054ms (0.7x) | 0.017ms (2.2x) | 0.017ms β(2.2x) | *0.036ms (1.0x)* |
| `Foreach(100000)` | 0.766ms (0.5x) π | 0.241ms (1.5x) | 0.135ms β(2.6x) π’ | 0.505ms (0.7x) | 0.145ms (2.5x) | 0.145ms β(2.5x) | *0.356ms (1.0x)* |
| `Foreach(1000000)` | 7.540ms (0.5x) π | 2.280ms (1.6x) | 1.431ms β(2.5x) π’ | 4.906ms (0.7x) | 1.524ms (2.4x) | 1.516ms β(2.4x) | *3.638ms (1.0x)* |
| `UnionWith(10000)` | 0.226ms (1.1x) | 0.144ms (1.8x) | 0.128ms β(2.0x) | 0.191ms (1.3x) | 0.119ms (2.1x) | 0.116ms β(2.2x) π’ | *0.254ms (1.0x)* π |
| `UnionWith(100000)` | 2.545ms (1.4x) | 1.664ms (2.1x) | 1.486ms β(2.3x) | 2.140ms (1.6x) | 1.370ms (2.5x) | 1.349ms β(2.6x) π’ | *3.441ms (1.0x)* π |
| `UnionWith(1000000)` | 80.802ms (0.7x) π | 43.823ms (1.4x) | 39.187ms β(1.5x) π’ | 74.811ms (0.8x) | 45.527ms (1.3x) | 40.115ms β(1.5x) | *59.785ms (1.0x)* |
| `IntersectWith(10000)` | 0.246ms (1.1x) | 0.142ms (1.9x) | 0.123ms β(2.2x) | 0.201ms (1.3x) | 0.107ms (2.5x) | 0.105ms β(2.6x) π’ | *0.270ms (1.0x)* π |
| `IntersectWith(100000)` | 2.705ms (1.3x) | 1.546ms (2.2x) | 1.405ms β(2.4x) | 2.218ms (1.5x) | 1.189ms (2.9x) π’ | 1.231ms β(2.8x) | *3.436ms (1.0x)* π |
| `IntersectWith(1000000)` | 33.228ms (2.0x) | 19.026ms (3.4x) | 17.066ms β(3.8x) | 27.030ms (2.4x) | 14.937ms (4.4x) π’ | 15.096ms β(4.3x) | *65.055ms (1.0x)* π |
| `ExceptWith(10000)` | 0.212ms (1.0x) | 0.125ms (1.7x) | 0.107ms β(2.0x) | 0.175ms (1.3x) | 0.094ms (2.3x) | 0.093ms β(2.4x) π’ | *0.218ms (1.0x)* π |
| `ExceptWith(100000)` | 2.374ms (1.2x) | 1.419ms (2.0x) | 1.257ms β(2.2x) | 1.992ms (1.4x) | 1.109ms (2.5x) π’ | 1.110ms β(2.5x) | *2.799ms (1.0x)* π |
| `ExceptWith(1000000)` | 35.627ms (1.1x) | 19.482ms (2.0x) | 17.001ms β(2.3x) | 29.688ms (1.3x) | 15.493ms (2.6x) π’ | 15.620ms β(2.5x) | *39.627ms (1.0x)* π |
*ΒΉ* Optimizations were disabled to perform this benchmark
*Β³* AddGrow(capacity, growTo) -- Incrementally grows from `capacity` until reaching size of `growTo`
---
### *List*
| Functionality | NativeList (S) | NativeList (S+B) | NativeList (B) | UnsafeList (S) | UnsafeList (S+B) | UnsafeList (B) | *List (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(0)`*ΒΉ* | 0.154ms (0.9x) | 0.121ms (1.2x) | 0.111ms β(1.3x) | 0.161ms (0.9x) π | 0.106ms β(1.3x) π’ | 0.106ms β(1.3x) π’ | *0.140ms (1.0x)* |
| `IsEmpty_x_100k(100)`*ΒΉ* | 0.154ms (0.9x) | 0.121ms (1.2x) | 0.111ms β(1.3x) | 0.161ms (0.9x) π | 0.106ms β(1.3x) | 0.106ms β(1.3x) π’ | *0.140ms (1.0x)* |
| `Count_x_100k(0)`*ΒΉ* | 0.120ms (1.0x) π | 0.111ms (1.1x) | 0.111ms β(1.1x) | 0.020ms (6.0x) π’ | 0.081ms β(1.5x) | 0.108ms β(1.1x) | *0.120ms (1.0x)* |
| `Count_x_100k(100)`*ΒΉ* | 0.120ms (1.0x) π | 0.111ms (1.1x) | 0.111ms β(1.1x) | 0.020ms (6.0x) π’ | 0.081ms β(1.5x) | 0.108ms β(1.1x) | *0.120ms (1.0x)* π |
| `ToNativeArray(10000)` | 0.002ms (1.4x) | 0.002ms (1.8x) | 0.002ms β(1.9x) π’ | --- | --- | --- | *0.003ms (1.0x)* π |
| `ToNativeArray(100000)` | 0.088ms (0.3x) π | 0.015ms (1.9x) | 0.015ms β(2.0x) π’ | --- | --- | --- | *0.029ms (1.0x)* |
| `ToNativeArray(1000000)` | 0.906ms (0.3x) π | 0.143ms (2.1x) π’ | 0.148ms β(2.1x) | --- | --- | --- | *0.306ms (1.0x)* |
| `Add(10000)` | 0.040ms (0.4x) π | 0.014ms (1.0x) | 0.016ms β(0.9x) | 0.017ms (0.9x) | 0.007ms β(2.2x) π’ | 0.007ms β(2.2x) | *0.014ms (1.0x)* |
| `Add(100000)` | 0.400ms (0.4x) π | 0.140ms (1.0x) | 0.155ms β(0.9x) | 0.166ms (0.9x) | 0.061ms β(2.3x) π’ | 0.061ms β(2.3x) π’ | *0.144ms (1.0x)* |
| `Add(1000000)` | 4.000ms (0.4x) π | 1.399ms (1.0x) | 1.548ms β(0.9x) | 1.654ms (0.9x) | 0.605ms β(2.4x) π’ | 0.608ms β(2.4x) | *1.436ms (1.0x)* |
| `AddGrow(4, 1048576)`*Β³* | 4.647ms (0.5x) π | 1.886ms (1.3x) | 1.759ms β(1.4x) | 2.141ms (1.1x) | 1.026ms β(2.3x) π’ | 1.033ms β(2.3x) | *2.402ms (1.0x)* |
| `AddGrow(65536, 1048576)`*Β³* | 4.604ms (0.5x) π | 1.865ms (1.3x) | 1.773ms β(1.3x) | 2.122ms (1.1x) | 1.083ms β(2.2x) | 1.010ms β(2.4x) π’ | *2.381ms (1.0x)* |
| `Contains(1000)` | 0.371ms (1.1x) | 0.086ms (4.6x) | 0.084ms β(4.7x) | 0.370ms (1.1x) | 0.148ms β(2.7x) | 0.084ms β(4.7x) π’ | *0.394ms (1.0x)* π |
| `Contains(10000)` | 37.241ms (1.2x) | 7.565ms (6.0x) | 7.548ms β(6.0x) | 37.203ms (1.2x) | 7.541ms β(6.0x) π’ | 7.544ms β(6.0x) | *45.509ms (1.0x)* π |
| `IndexedRead(10000)` | 0.037ms (0.6x) π | 0.009ms (2.7x) | 0.005ms β(4.8x) | 0.022ms (1.0x) | 0.005ms β(5.0x) π’ | 0.005ms β(4.9x) | *0.023ms (1.0x)* |
| `IndexedRead(100000)` | 0.474ms (0.7x) π | 0.090ms (3.6x) | 0.068ms β(4.8x) | 0.268ms (1.2x) | 0.077ms β(4.2x) | 0.068ms β(4.8x) π’ | *0.328ms (1.0x)* |
| `IndexedRead(1000000)` | 5.416ms (0.7x) π | 1.487ms (2.6x) | 1.341ms β(2.9x) π’ | 3.197ms (1.2x) | 1.395ms β(2.8x) | 1.357ms β(2.9x) | *3.897ms (1.0x)* |
| `IndexedWrite(10000)` | 0.028ms (1.0x) | 0.011ms (2.6x) | 0.007ms β(4.4x) | 0.018ms (1.6x) | 0.006ms β(4.6x) π’ | 0.010ms β(3.0x) | *0.029ms (1.0x)* π |
| `IndexedWrite(100000)` | 0.311ms (1.1x) | 0.125ms (2.7x) π’ | 0.135ms β(2.5x) | 0.220ms (1.5x) | 0.136ms β(2.4x) | 0.132ms β(2.5x) | *0.331ms (1.0x)* π |
| `IndexedWrite(1000000)` | 3.656ms (1.1x) | 1.892ms (2.1x) | 1.868ms β(2.1x) | 2.775ms (1.4x) | 1.796ms β(2.2x) | 1.744ms β(2.3x) π’ | *3.956ms (1.0x)* π |
| `Remove(1000)` | 0.087ms (0.3x) π | 0.011ms (1.9x) | 0.011ms β(2.1x) | 0.085ms (0.3x) | 0.011ms β(2.0x) | 0.010ms β(2.2x) π’ | *0.022ms (1.0x)* |
| `Remove(10000)` | 7.626ms (0.1x) π | 0.732ms (1.2x) | 0.717ms β(1.2x) | 7.616ms (0.1x) | 0.716ms β(1.2x) | 0.704ms β(1.2x) π’ | *0.853ms (1.0x)* |
| `Foreach(10000)` | 0.038ms (0.6x) π | 0.004ms (5.8x) | 0.003ms β(8.8x) | 0.016ms (1.5x) | 0.003ms β(9.0x) π’ | 0.003ms β(9.0x) π’ | *0.024ms (1.0x)* |
| `Foreach(100000)` | 0.381ms (0.6x) π | 0.037ms (6.5x) | 0.024ms (10.0x) | 0.160ms (1.5x) | 0.024ms (10.0x) π’ | 0.024ms (10.0x) π’ | *0.242ms (1.0x)* |
| `Foreach(1000000)` | 3.815ms (0.6x) π | 0.360ms (6.7x) | 0.229ms (10.6x) | 1.621ms (1.5x) | 0.226ms (10.7x) π’ | 0.226ms (10.7x) | *2.419ms (1.0x)* |
*ΒΉ* Optimizations were disabled to perform this benchmark
*Β³* AddGrow(capacity, growTo) -- Incrementally grows from `capacity` until reaching size of `growTo`
---
### *ParallelHashMap*
| Functionality | NativeParallelHashMap (S) | NativeParallelHashMap (S+B) | NativeParallelHashMap (B) | UnsafeParallelHashMap (S) | UnsafeParallelHashMap (S+B) | UnsafeParallelHashMap (B) | *ConcurrentDictionary (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(1, 0)`*ΒΉ* | 0.462ms β(176.1x) | 0.141ms β(577.9x) | 0.109ms β(748.4x) π’ | 0.261ms β(312.0x) | 0.162ms β(501.5x) | 0.174ms β(469.0x) | *81.423ms (1.0x)* π |
| `IsEmpty_x_100k(2, 0)`*ΒΉΛΒ²* | 0.234ms β(551.2x) | 0.072ms (1782.5x) π’ | 0.090ms (1427.8x) | 0.134ms β(965.2x) | 0.096ms (1338.9x) | 0.091ms (1412.9x) | *129.140ms (1.0x)* π |
| `IsEmpty_x_100k(4, 0)`*ΒΉΛΒ²* | 0.267ms β(644.7x) | 0.042ms (4088.3x) π’ | 0.050ms (3473.0x) | 0.078ms (2214.0x) | 0.048ms (3604.1x) | 0.047ms (3626.9x) | *171.914ms (1.0x)* π |
| `IsEmpty_x_100k(1, 100)`*ΒΉ* | 0.682ms β(114.0x) | 0.238ms β(326.4x) | 0.242ms β(322.0x) | 0.582ms β(133.7x) | 0.181ms β(429.8x) | 0.181ms β(429.9x) π’ | *77.786ms (1.0x)* π |
| `IsEmpty_x_100k(2, 100)`*ΒΉΛΒ²* | 0.380ms β(341.5x) | 0.124ms (1046.8x) | 0.142ms β(911.2x) | 0.295ms β(440.2x) | 0.093ms (1399.5x) π’ | 0.095ms (1370.0x) | *129.804ms (1.0x)* π |
| `IsEmpty_x_100k(4, 100)`*ΒΉΛΒ²* | 0.354ms β(490.4x) | 0.114ms (1518.7x) | 0.125ms (1385.9x) | 0.217ms β(799.6x) | 0.109ms (1596.9x) | 0.062ms (2818.0x) π’ | *173.587ms (1.0x)* π |
| `Count_x_100k(1, 0)`*ΒΉ* | 0.535ms β(150.8x) | 0.201ms β(401.0x) | 0.155ms β(521.9x) π’ | 0.287ms β(280.9x) | 0.181ms β(445.7x) | 0.161ms β(501.3x) | *80.634ms (1.0x)* π |
| `Count_x_100k(2, 0)`*ΒΉΛΒ²* | 0.271ms β(455.4x) | 0.103ms (1195.2x) | 0.080ms (1532.7x) π’ | 0.148ms β(831.5x) | 0.093ms (1326.5x) | 0.083ms (1491.0x) | *123.229ms (1.0x)* π |
| `Count_x_100k(4, 0)`*ΒΉΛΒ²* | 0.144ms (1320.5x) | 0.061ms (3106.4x) | 0.046ms (4132.8x) π’ | 0.083ms (2294.1x) | 0.103ms (1846.0x) | 0.051ms (3730.1x) | *189.491ms (1.0x)* π |
| `Count_x_100k(1, 100)`*ΒΉ* | 3.685ms ββ(25.7x) | 1.444ms ββ(65.7x) π’ | 1.693ms ββ(56.0x) | 3.191ms ββ(29.7x) | 1.544ms ββ(61.4x) | 1.614ms ββ(58.8x) | *94.884ms (1.0x)* π |
| `Count_x_100k(2, 100)`*ΒΉΛΒ²* | 1.845ms ββ(73.9x) | 0.736ms β(185.3x) π’ | 0.887ms β(153.8x) | 1.595ms ββ(85.5x) | 0.773ms β(176.6x) | 0.825ms β(165.4x) | *136.423ms (1.0x)* π |
| `Count_x_100k(4, 100)`*ΒΉΛΒ²* | 1.613ms β(113.9x) | 0.708ms β(259.3x) | 0.707ms β(259.9x) | 1.460ms β(125.8x) | 0.746ms β(246.2x) | 0.689ms β(266.5x) π’ | *183.655ms (1.0x)* π |
| `ToNativeArrayKeys(1, 10000)` | 0.150ms βββ(1.2x) | 0.121ms βββ(1.5x) | 0.081ms βββ(2.2x) π’ | 0.201ms βββ(0.9x) π | 0.129ms βββ(1.4x) | 0.111ms βββ(1.6x) | *0.180ms (1.0x)* |
| `ToNativeArrayKeys(1, 100000)` | 1.652ms βββ(1.4x) | 1.243ms βββ(1.9x) | 1.052ms βββ(2.2x) π’ | 1.796ms βββ(1.3x) | 1.402ms βββ(1.7x) | 1.053ms βββ(2.2x) | *2.336ms (1.0x)* π |
| `ToNativeArrayKeys(1, 1000000)` | 36.653ms βββ(0.7x) π | 17.665ms βββ(1.4x) | 12.848ms βββ(2.0x) | 36.236ms βββ(0.7x) | 18.985ms βββ(1.3x) | 10.798ms βββ(2.3x) π’ | *25.361ms (1.0x)* |
| `ToNativeArrayValues(1, 10000)` | 0.150ms βββ(0.9x) | 0.121ms βββ(1.2x) | 0.080ms βββ(1.8x) | 0.151ms βββ(0.9x) π | 0.122ms βββ(1.2x) | 0.079ms βββ(1.8x) π’ | *0.141ms (1.0x)* |
| `ToNativeArrayValues(1, 100000)` | 1.626ms βββ(1.1x) | 1.235ms βββ(1.4x) | 0.862ms βββ(2.1x) π’ | 1.629ms βββ(1.1x) | 1.229ms βββ(1.4x) | 0.872ms βββ(2.0x) | *1.773ms (1.0x)* π |
| `ToNativeArrayValues(1, 1000000)` | 20.867ms βββ(1.1x) | 15.371ms βββ(1.5x) | 11.046ms βββ(2.1x) | 24.782ms βββ(1.0x) π | 17.345ms βββ(1.4x) | 10.785ms βββ(2.2x) π’ | *23.593ms (1.0x)* |
| `Insert(1, 10000)` | 0.353ms βββ(5.6x) | 0.209ms βββ(9.5x) | 0.212ms βββ(9.3x) | 0.320ms βββ(6.2x) | 0.205ms βββ(9.6x) π’ | 0.211ms βββ(9.4x) | *1.979ms (1.0x)* π |
| `Insert(2, 10000)`*Β²* | 0.543ms βββ(4.3x) | 0.514ms βββ(4.5x) | 0.329ms βββ(7.1x) | 0.400ms βββ(5.8x) | 0.266ms βββ(8.8x) π’ | 0.379ms βββ(6.1x) | *2.330ms (1.0x)* π |
| `Insert(4, 10000)`*Β²* | 0.449ms βββ(5.2x) | 0.290ms βββ(8.0x) | 0.217ms ββ(10.6x) π’ | 0.285ms βββ(8.1x) | 0.249ms βββ(9.3x) | 0.270ms βββ(8.6x) | *2.314ms (1.0x)* π |
| `Insert(1, 100000)` | 3.818ms βββ(5.8x) | 2.325ms βββ(9.5x) | 2.281ms βββ(9.6x) | 3.442ms βββ(6.4x) | 2.218ms βββ(9.9x) π’ | 2.285ms βββ(9.6x) | *21.983ms (1.0x)* π |
| `Insert(2, 100000)`*Β²* | 5.611ms βββ(4.1x) | 4.873ms βββ(4.8x) | 3.254ms βββ(7.1x) | 4.090ms βββ(5.7x) | 2.645ms βββ(8.8x) π’ | 3.080ms βββ(7.5x) | *23.181ms (1.0x)* π |
| `Insert(4, 100000)`*Β²* | 4.523ms βββ(5.3x) | 2.897ms βββ(8.3x) | 2.156ms ββ(11.2x) | 3.541ms βββ(6.8x) | 2.201ms ββ(11.0x) | 2.096ms ββ(11.5x) π’ | *24.121ms (1.0x)* π |
| `Insert(1, 1000000)` | 60.383ms βββ(7.0x) | 36.007ms ββ(11.8x) π’ | 36.109ms ββ(11.8x) | 53.923ms βββ(7.9x) | 36.016ms ββ(11.8x) | 36.542ms ββ(11.6x) | *425.024ms (1.0x)* π |
| `Insert(2, 1000000)`*Β²* | 62.895ms βββ(7.1x) | 50.118ms βββ(8.9x) | 40.151ms ββ(11.1x) | 50.271ms βββ(8.8x) | 39.964ms ββ(11.1x) | 38.384ms ββ(11.6x) π’ | *443.920ms (1.0x)* π |
| `Insert(4, 1000000)`*Β²* | 42.694ms βββ(7.6x) | 36.240ms βββ(9.0x) | 24.896ms ββ(13.1x) | 30.771ms ββ(10.6x) | 24.408ms ββ(13.3x) π’ | 25.097ms ββ(13.0x) | *325.595ms (1.0x)* π |
| `AddGrow(1, 4, 1048576)`*Β³* | 72.547ms βββ(5.9x) | 39.816ms ββ(10.7x) | 39.313ms ββ(10.8x) | 71.458ms βββ(6.0x) | 39.813ms ββ(10.7x) | 39.265ms ββ(10.8x) π’ | *425.495ms (1.0x)* π |
| `AddGrow(1, 65536, 1048576)`*Β³* | 68.046ms ββ(10.0x) | 39.004ms ββ(17.5x) | 38.764ms ββ(17.6x) | 67.198ms ββ(10.2x) | 38.417ms ββ(17.8x) π’ | 38.540ms ββ(17.7x) | *683.780ms (1.0x)* π |
| `Contains(1, 10000)` | 0.145ms βββ(1.6x) | 0.033ms βββ(6.9x) | 0.028ms βββ(8.0x) π’ | 0.118ms βββ(1.9x) | 0.036ms βββ(6.3x) | 0.029ms βββ(7.9x) | *0.228ms (1.0x)* π |
| `Contains(2, 10000)`*Β²* | 0.127ms βββ(1.5x) | 0.042ms βββ(4.6x) | 0.036ms βββ(5.4x) π’ | 0.111ms βββ(1.8x) | 0.038ms βββ(5.2x) | 0.036ms βββ(5.3x) | *0.194ms (1.0x)* π |
| `Contains(4, 10000)`*Β²* | 0.167ms βββ(1.3x) | 0.052ms βββ(4.1x) | 0.055ms βββ(3.9x) | 0.100ms βββ(2.1x) | 0.068ms βββ(3.1x) | 0.039ms βββ(5.5x) π’ | *0.213ms (1.0x)* π |
| `Contains(1, 100000)` | 2.247ms βββ(1.5x) | 0.650ms βββ(5.0x) | 0.498ms βββ(6.6x) π’ | 1.849ms βββ(1.8x) | 0.650ms βββ(5.0x) | 0.500ms βββ(6.6x) | *3.277ms (1.0x)* π |
| `Contains(2, 100000)`*Β²* | 1.226ms βββ(1.4x) | 0.403ms βββ(4.4x) | 0.328ms βββ(5.4x) π’ | 1.077ms βββ(1.6x) | 0.408ms βββ(4.3x) | 0.330ms βββ(5.3x) | *1.761ms (1.0x)* π |
| `Contains(4, 100000)`*Β²* | 1.065ms βββ(2.2x) | 0.334ms βββ(7.0x) | 0.268ms βββ(8.7x) π’ | 0.883ms βββ(2.6x) | 0.319ms βββ(7.3x) | 0.540ms βββ(4.3x) | *2.332ms (1.0x)* π |
| `Contains(1, 1000000)` | 66.122ms βββ(1.5x) | 16.585ms βββ(5.9x) | 12.089ms βββ(8.0x) π’ | 59.523ms βββ(1.6x) | 17.021ms βββ(5.7x) | 12.118ms βββ(8.0x) | *97.095ms (1.0x)* π |
| `Contains(2, 1000000)`*Β²* | 31.624ms βββ(1.6x) | 8.707ms βββ(5.8x) | 6.498ms βββ(7.8x) π’ | 29.568ms βββ(1.7x) | 8.714ms βββ(5.8x) | 6.511ms βββ(7.8x) | *50.806ms (1.0x)* π |
| `Contains(4, 1000000)`*Β²* | 25.406ms βββ(1.7x) | 6.925ms βββ(6.3x) | 5.677ms βββ(7.7x) | 22.636ms βββ(1.9x) | 6.716ms βββ(6.5x) | 5.494ms βββ(7.9x) π’ | *43.614ms (1.0x)* π |
| `IndexedRead(1, 10000)` | 0.145ms βββ(1.6x) | 0.029ms βββ(8.1x) π’ | 0.032ms βββ(7.3x) | 0.137ms βββ(1.7x) | 0.031ms βββ(7.5x) | 0.031ms βββ(7.7x) | *0.235ms (1.0x)* π |
| `IndexedRead(2, 10000)`*Β²* | 0.202ms βββ(1.4x) | 0.059ms βββ(4.9x) | 0.062ms βββ(4.7x) | 0.191ms βββ(1.5x) | 0.041ms βββ(7.0x) π’ | 0.066ms βββ(4.4x) | *0.288ms (1.0x)* π |
| `IndexedRead(4, 10000)`*Β²* | 0.581ms βββ(0.9x) π | 0.129ms βββ(3.9x) | 0.098ms βββ(5.1x) | 0.264ms βββ(1.9x) | 0.071ms βββ(7.1x) π’ | 0.097ms βββ(5.2x) | *0.501ms (1.0x)* |
| `IndexedRead(1, 100000)` | 2.216ms βββ(1.5x) | 0.592ms βββ(5.6x) π’ | 0.604ms βββ(5.5x) | 2.140ms βββ(1.5x) | 0.600ms βββ(5.5x) | 0.607ms βββ(5.4x) | *3.291ms (1.0x)* π |
| `IndexedRead(2, 100000)`*Β²* | 2.416ms βββ(1.5x) | 0.698ms βββ(5.0x) | 0.692ms βββ(5.1x) π’ | 2.270ms βββ(1.5x) | 0.707ms βββ(5.0x) | 0.743ms βββ(4.7x) | *3.506ms (1.0x)* π |
| `IndexedRead(4, 100000)`*Β²* | 4.094ms βββ(1.4x) | 1.071ms βββ(5.4x) | 1.053ms βββ(5.5x) π’ | 7.214ms βββ(0.8x) π | 1.058ms βββ(5.5x) | 1.794ms βββ(3.2x) | *5.780ms (1.0x)* |
| `IndexedRead(1, 1000000)` | 64.603ms βββ(1.5x) | 17.636ms βββ(5.5x) | 17.726ms βββ(5.5x) | 62.234ms βββ(1.6x) | 17.652ms βββ(5.5x) | 17.411ms βββ(5.6x) π’ | *96.983ms (1.0x)* π |
| `IndexedRead(2, 1000000)`*Β²* | 63.460ms βββ(1.6x) | 17.217ms βββ(5.8x) | 17.124ms βββ(5.8x) | 61.578ms βββ(1.6x) | 17.127ms βββ(5.8x) | 16.957ms βββ(5.8x) π’ | *99.146ms (1.0x)* π |
| `IndexedRead(4, 1000000)`*Β²* | 68.243ms βββ(1.4x) | 28.318ms βββ(3.4x) | 27.812ms βββ(3.5x) | 69.192ms βββ(1.4x) | 26.990ms βββ(3.6x) π’ | 27.918ms βββ(3.5x) | *97.383ms (1.0x)* π |
| `IndexedWrite(1, 10000)` | 0.164ms βββ(2.8x) | 0.051ms βββ(9.0x) | 0.041ms ββ(11.0x) | 0.131ms βββ(3.5x) | 0.040ms ββ(11.4x) | 0.038ms ββ(12.0x) π’ | *0.456ms (1.0x)* π |
| `IndexedWrite(1, 100000)` | 2.333ms βββ(2.6x) | 0.901ms βββ(6.7x) | 0.731ms βββ(8.3x) | 2.077ms βββ(2.9x) | 0.781ms βββ(7.8x) | 0.710ms βββ(8.5x) π’ | *6.067ms (1.0x)* π |
| `IndexedWrite(1, 1000000)` | 76.627ms βββ(2.5x) | 67.296ms βββ(2.8x) π’ | 68.052ms βββ(2.8x) | 85.977ms βββ(2.2x) | 68.516ms βββ(2.8x) | 69.221ms βββ(2.8x) | *191.108ms (1.0x)* π |
| `TryGetValue(1, 10000)` | 0.154ms βββ(1.3x) | 0.043ms βββ(4.8x) | 0.032ms βββ(6.4x) | 0.117ms βββ(1.8x) | 0.043ms βββ(4.8x) | 0.031ms βββ(6.6x) π’ | *0.206ms (1.0x)* π |
| `TryGetValue(2, 10000)`*Β²* | 0.125ms βββ(1.4x) | 0.045ms βββ(3.8x) | 0.036ms βββ(4.8x) π’ | 0.110ms βββ(1.6x) | 0.046ms βββ(3.7x) | 0.036ms βββ(4.8x) | *0.172ms (1.0x)* π |
| `TryGetValue(4, 10000)`*Β²* | 0.170ms βββ(0.7x) π | 0.051ms βββ(2.4x) | 0.038ms βββ(3.3x) π’ | 0.103ms βββ(1.2x) | 0.078ms βββ(1.6x) | 0.039ms βββ(3.2x) | *0.125ms (1.0x)* |
| `TryGetValue(1, 100000)` | 2.187ms βββ(1.5x) | 0.839ms βββ(4.0x) | 0.616ms βββ(5.4x) π’ | 1.925ms βββ(1.7x) | 0.815ms βββ(4.1x) | 0.628ms βββ(5.3x) | *3.336ms (1.0x)* π |
| `TryGetValue(2, 100000)`*Β²* | 1.216ms βββ(1.5x) | 0.478ms βββ(3.7x) | 0.342ms βββ(5.2x) π’ | 1.072ms βββ(1.7x) | 0.489ms βββ(3.6x) | 0.391ms βββ(4.5x) | *1.769ms (1.0x)* π |
| `TryGetValue(4, 100000)`*Β²* | 1.042ms βββ(1.7x) | 0.408ms βββ(4.3x) π’ | 0.617ms βββ(2.8x) | 0.899ms βββ(1.9x) | 0.915ms βββ(1.9x) | 0.636ms βββ(2.7x) | *1.736ms (1.0x)* π |
| `TryGetValue(1, 1000000)` | 65.145ms βββ(1.5x) | 25.321ms βββ(3.8x) | 19.163ms βββ(5.0x) | 59.895ms βββ(1.6x) | 23.602ms βββ(4.1x) | 18.464ms βββ(5.2x) π’ | *96.395ms (1.0x)* π |
| `TryGetValue(2, 1000000)`*Β²* | 31.724ms βββ(1.5x) | 12.422ms βββ(4.0x) | 9.631ms βββ(5.1x) | 30.638ms βββ(1.6x) | 12.432ms βββ(4.0x) | 9.589ms βββ(5.1x) π’ | *49.107ms (1.0x)* π |
| `TryGetValue(4, 1000000)`*Β²* | 25.831ms βββ(1.6x) | 10.070ms βββ(4.1x) | 7.992ms βββ(5.2x) π’ | 23.710ms βββ(1.8x) | 10.235ms βββ(4.1x) | 8.062ms βββ(5.2x) | *41.691ms (1.0x)* π |
| `Remove(1, 10000)` | 0.120ms βββ(4.5x) | 0.214ms βββ(2.5x) | 0.050ms ββ(11.0x) | 0.095ms βββ(5.7x) | 0.050ms ββ(10.9x) | 0.049ms ββ(11.1x) π’ | *0.545ms (1.0x)* π |
| `Remove(1, 100000)` | 1.928ms βββ(3.4x) | 0.929ms βββ(7.0x) | 0.805ms βββ(8.1x) | 1.682ms βββ(3.9x) | 0.867ms βββ(7.5x) | 0.793ms βββ(8.2x) π’ | *6.512ms (1.0x)* π |
| `Remove(1, 1000000)` | 64.353ms βββ(3.1x) | 56.893ms βββ(3.5x) π’ | 57.422ms βββ(3.4x) | 62.480ms βββ(3.1x) | 57.884ms βββ(3.4x) | 57.271ms βββ(3.4x) | *196.582ms (1.0x)* π |
| `Foreach(1, 10000)` | 0.156ms βββ(2.5x) | 0.086ms βββ(4.6x) | 0.073ms βββ(5.4x) π’ | 0.143ms βββ(2.7x) | 0.080ms βββ(4.9x) | 0.080ms βββ(4.9x) | *0.393ms (1.0x)* π |
| `Foreach(1, 100000)` | 2.094ms βββ(2.3x) | 0.931ms βββ(5.2x) | 0.839ms βββ(5.8x) π’ | 1.862ms βββ(2.6x) | 0.885ms βββ(5.5x) | 0.884ms βββ(5.5x) | *4.876ms (1.0x)* π |
| `Foreach(1, 1000000)` | 28.544ms βββ(2.0x) | 11.060ms βββ(5.1x) | 10.143ms βββ(5.6x) π’ | 27.167ms βββ(2.1x) | 10.318ms βββ(5.5x) | 10.364ms βββ(5.5x) | *56.852ms (1.0x)* π |
*ΒΉ* Optimizations were disabled to perform this benchmark
*Β²* Benchmark run on parallel job workers - results may vary
*Β³* AddGrow(workers, capacity, growTo) -- Incrementally grows from `capacity` until reaching size of `growTo`
---
### *ParallelHashSet*
| Functionality | NativeParallelHashSet (S) | NativeParallelHashSet (S+B) | NativeParallelHashSet (B) | UnsafeParallelHashSet (S) | UnsafeParallelHashSet (S+B) | UnsafeParallelHashSet (B) | *HashSet w/lock (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(1, 0)`*ΒΉ* | 0.482ms ββ(9.2x) | 0.115ms β(38.5x) π’ | 0.176ms β(25.1x) | 0.301ms β(14.7x) | 0.183ms β(24.2x) | 0.171ms β(25.8x) | *4.422ms (1.0x)* π |
| `IsEmpty_x_100k(2, 0)`*ΒΉΛΒ²* | 0.244ms β(61.6x) | 0.060ms (250.7x) π’ | 0.092ms (164.2x) | 0.154ms β(98.0x) | 0.091ms (166.2x) | 0.086ms (175.3x) | *15.041ms (1.0x)* π |
| `IsEmpty_x_100k(4, 0)`*ΒΉΛΒ²* | 0.274ms (114.9x) | 0.037ms (849.5x) π’ | 0.048ms (659.1x) | 0.153ms (206.3x) | 0.049ms (640.4x) | 0.047ms (667.5x) | *31.474ms (1.0x)* π |
| `IsEmpty_x_100k(1, 100)`*ΒΉ* | 0.567ms ββ(7.8x) | 0.128ms β(34.7x) | 0.201ms β(22.0x) | 0.401ms β(11.0x) | 0.142ms β(31.2x) | 0.108ms β(40.9x) π’ | *4.424ms (1.0x)* π |
| `IsEmpty_x_100k(2, 100)`*ΒΉΛΒ²* | 0.288ms β(52.5x) | 0.068ms (221.0x) | 0.105ms (143.5x) | 0.217ms β(69.9x) | 0.074ms (205.5x) | 0.057ms (264.5x) π’ | *15.128ms (1.0x)* π |
| `IsEmpty_x_100k(4, 100)`*ΒΉΛΒ²* | 0.315ms β(99.6x) | 0.072ms (437.6x) | 0.058ms (538.5x) | 0.185ms (169.8x) | 0.046ms (686.0x) | 0.037ms (842.3x) π’ | *31.420ms (1.0x)* π |
| `Count_x_100k(1, 0)`*ΒΉ* | 0.535ms ββ(8.3x) | 0.201ms β(22.1x) | 0.161ms β(27.6x) | 0.456ms ββ(9.7x) | 0.181ms β(24.5x) | 0.161ms β(27.6x) π’ | *4.435ms (1.0x)* π |
| `Count_x_100k(2, 0)`*ΒΉΛΒ²* | 0.271ms β(59.0x) | 0.103ms (155.8x) | 0.082ms (193.8x) π’ | 0.231ms β(69.1x) | 0.093ms (171.9x) | 0.083ms (192.9x) | *15.965ms (1.0x)* π |
| `Count_x_100k(4, 0)`*ΒΉΛΒ²* | 0.224ms (173.7x) | 0.115ms (337.8x) | 0.049ms (789.8x) π’ | 0.164ms (237.0x) | 0.054ms (724.3x) | 0.073ms (529.1x) | *38.861ms (1.0x)* π |
| `Count_x_100k(1, 100)`*ΒΉ* | 4.426ms ββ(1.0x) | 1.620ms ββ(2.7x) | 1.517ms ββ(2.9x) π’ | 3.323ms ββ(1.3x) | 1.538ms ββ(2.9x) | 2.268ms ββ(2.0x) | *4.438ms (1.0x)* π |
| `Count_x_100k(2, 100)`*ΒΉΛΒ²* | 2.462ms ββ(6.2x) | 1.020ms β(14.9x) | 0.763ms β(19.9x) π’ | 1.683ms ββ(9.0x) | 0.783ms β(19.4x) | 0.824ms β(18.4x) | *15.206ms (1.0x)* π |
| `Count_x_100k(4, 100)`*ΒΉΛΒ²* | 1.778ms β(18.1x) | 0.848ms β(37.9x) | 0.723ms β(44.5x) | 1.556ms β(20.7x) | 0.744ms β(43.2x) | 0.665ms β(48.4x) π’ | *32.165ms (1.0x)* π |
| `ToNativeArray(1, 10000)` | 0.039ms ββ(0.5x) π | 0.021ms ββ(0.8x) | 0.009ms ββ(1.9x) | 0.038ms ββ(0.5x) | 0.021ms ββ(0.8x) | 0.009ms ββ(1.9x) π’ | *0.018ms (1.0x)* |
| `ToNativeArray(1, 100000)` | 0.428ms ββ(0.4x) | 0.202ms ββ(0.9x) | 0.084ms ββ(2.1x) π’ | 0.437ms ββ(0.4x) π | 0.202ms ββ(0.9x) | 0.084ms ββ(2.1x) π’ | *0.175ms (1.0x)* |
| `ToNativeArray(1, 1000000)` | 4.489ms ββ(0.4x) | 2.192ms ββ(0.9x) | 1.051ms ββ(1.9x) π’ | 4.690ms ββ(0.4x) π | 2.187ms ββ(0.9x) | 1.053ms ββ(1.9x) | *1.964ms (1.0x)* |
| `Insert(1, 10000)` | 0.330ms β(11.3x) | 0.188ms β(19.7x) | 0.196ms β(19.0x) | 0.301ms β(12.4x) | 0.186ms β(20.0x) π’ | 0.202ms β(18.4x) | *3.715ms (1.0x)* π |
| `Insert(2, 10000)`*Β²* | 0.468ms β(33.2x) | 0.487ms β(31.9x) | 0.264ms β(58.9x) | 0.317ms β(49.0x) | 0.260ms β(59.8x) π’ | 0.331ms β(47.0x) | *15.537ms (1.0x)* π |
| `Insert(4, 10000)`*Β²* | 0.285ms (168.3x) | 0.319ms (150.7x) | 0.169ms (283.9x) π’ | 0.244ms (196.6x) | 0.207ms (231.4x) | 0.225ms (212.9x) | *48.000ms (1.0x)* π |
| `Insert(1, 100000)` | 3.300ms ββ(1.8x) | 1.880ms ββ(3.1x) | 1.957ms ββ(3.0x) | 3.014ms ββ(1.9x) | 1.857ms ββ(3.2x) π’ | 2.079ms ββ(2.8x) | *5.872ms (1.0x)* π |
| `Insert(2, 100000)`*Β²* | 4.849ms ββ(3.2x) | 4.541ms ββ(3.4x) | 2.555ms ββ(6.1x) π’ | 3.014ms ββ(5.1x) | 3.288ms ββ(4.7x) | 3.275ms ββ(4.7x) | *15.510ms (1.0x)* π |
| `Insert(4, 100000)`*Β²* | 2.759ms β(16.9x) | 2.462ms β(19.0x) | 1.494ms β(31.3x) π’ | 2.236ms β(20.9x) | 2.221ms β(21.0x) | 1.804ms β(25.9x) | *46.684ms (1.0x)* π |
| `Insert(1, 1000000)` | 33.989ms ββ(1.8x) | 19.882ms ββ(3.1x) | 20.803ms ββ(3.0x) | 31.233ms ββ(2.0x) | 19.637ms ββ(3.1x) π’ | 20.789ms ββ(3.0x) | *61.451ms (1.0x)* π |
| `Insert(2, 1000000)`*Β²* | 48.854ms ββ(1.4x) | 46.969ms ββ(1.5x) | 27.594ms ββ(2.5x) π’ | 31.891ms ββ(2.2x) | 33.639ms ββ(2.1x) | 35.067ms ββ(2.0x) | *70.068ms (1.0x)* π |
| `Insert(4, 1000000)`*Β²* | 32.946ms ββ(2.8x) | 28.736ms ββ(3.2x) | 18.753ms ββ(4.9x) π’ | 21.186ms ββ(4.3x) | 24.702ms ββ(3.7x) | 21.382ms ββ(4.3x) | *91.349ms (1.0x)* π |
| `AddGrow(1, 4, 1048576)`*Β³* | 36.009ms ββ(1.8x) | 12.228ms ββ(5.4x) | 11.699ms ββ(5.6x) π’ | 34.592ms ββ(1.9x) | 11.898ms ββ(5.5x) | 11.875ms ββ(5.6x) | *65.912ms (1.0x)* π |
| `AddGrow(1, 65536, 1048576)`*Β³* | 33.973ms ββ(1.7x) | 11.863ms ββ(4.9x) | 11.247ms ββ(5.2x) | 32.550ms ββ(1.8x) | 11.464ms ββ(5.1x) | 11.203ms ββ(5.2x) π’ | *58.064ms (1.0x)* π |
| `Contains(1, 10000)` | 0.109ms ββ(5.6x) | 0.019ms β(32.3x) | 0.013ms β(47.2x) | 0.095ms ββ(6.4x) | 0.017ms β(35.8x) | 0.010ms β(60.2x) π’ | *0.611ms (1.0x)* π |
| `Contains(2, 10000)`*Β²* | 0.101ms (141.6x) | 0.019ms (749.5x) π’ | 0.021ms (683.2x) | 0.060ms (239.8x) | 0.019ms (747.6x) | 0.021ms (683.2x) | *14.279ms (1.0x)* π |
| `Contains(4, 10000)`*Β²* | 0.098ms (128.3x) | 0.031ms (402.6x) | 0.023ms (559.2x) | 0.057ms (219.8x) | 0.021ms (607.8x) π’ | 0.022ms (561.7x) | *12.582ms (1.0x)* π |
| `Contains(1, 100000)` | 1.531ms ββ(4.6x) | 0.284ms β(24.8x) | 0.191ms β(36.8x) | 1.345ms ββ(5.2x) | 0.300ms β(23.5x) | 0.191ms β(36.9x) π’ | *7.043ms (1.0x)* π |
| `Contains(2, 100000)`*Β²* | 0.925ms β(23.2x) | 0.225ms β(95.8x) | 0.165ms (130.4x) π’ | 0.827ms β(26.0x) | 0.227ms β(94.7x) | 0.166ms (129.7x) | *21.506ms (1.0x)* π |
| `Contains(4, 100000)`*Β²* | 0.717ms β(46.9x) | 0.204ms (164.7x) | 0.120ms (279.4x) π’ | 0.689ms β(48.8x) | 0.389ms β(86.5x) | 0.275ms (122.2x) | *33.617ms (1.0x)* π |
| `Contains(1, 1000000)` | 18.170ms ββ(4.5x) | 3.754ms β(21.7x) | 2.522ms β(32.4x) | 16.496ms ββ(4.9x) | 3.749ms β(21.8x) | 2.491ms β(32.8x) π’ | *81.628ms (1.0x)* π |
| `Contains(2, 1000000)`*Β²* | 11.131ms ββ(7.8x) | 2.652ms β(32.7x) | 2.045ms β(42.5x) π’ | 9.589ms ββ(9.1x) | 2.733ms β(31.8x) | 2.076ms β(41.8x) | *86.828ms (1.0x)* π |
| `Contains(4, 1000000)`*Β²* | 8.584ms β(12.8x) | 3.407ms β(32.3x) | 2.220ms β(49.5x) | 8.219ms β(13.4x) | 2.053ms β(53.5x) π’ | 2.324ms β(47.3x) | *109.936ms (1.0x)* π |
| `Remove(1, 10000)` | 0.139ms ββ(4.4x) | 0.065ms ββ(9.3x) | 0.059ms β(10.3x) π’ | 0.110ms ββ(5.6x) | 0.061ms β(10.0x) | 0.060ms β(10.2x) | *0.611ms (1.0x)* π |
| `Remove(1, 100000)` | 1.694ms ββ(3.9x) | 0.798ms ββ(8.4x) | 0.689ms ββ(9.7x) π’ | 1.314ms ββ(5.1x) | 0.707ms ββ(9.5x) | 0.695ms ββ(9.6x) | *6.684ms (1.0x)* π |
| `Remove(1, 1000000)` | 20.302ms ββ(3.7x) | 9.389ms ββ(8.0x) | 7.772ms ββ(9.7x) π’ | 15.004ms ββ(5.0x) | 8.087ms ββ(9.3x) | 7.788ms ββ(9.6x) | *75.082ms (1.0x)* π |
| `Foreach(1, 10000)` | 0.097ms ββ(0.4x) π | 0.024ms ββ(1.4x) | 0.018ms ββ(1.9x) | 0.068ms ββ(0.5x) | 0.018ms ββ(2.0x) π’ | 0.018ms ββ(2.0x) | *0.035ms (1.0x)* |
| `Foreach(1, 100000)` | 0.929ms ββ(0.4x) π | 0.208ms ββ(1.7x) | 0.145ms ββ(2.4x) | 0.605ms ββ(0.6x) | 0.144ms ββ(2.4x) π’ | 0.144ms ββ(2.4x) | *0.344ms (1.0x)* |
| `Foreach(1, 1000000)` | 9.214ms ββ(0.4x) π | 2.094ms ββ(1.7x) | 1.470ms ββ(2.5x) | 5.994ms ββ(0.6x) | 1.462ms ββ(2.5x) π’ | 1.491ms ββ(2.4x) | *3.611ms (1.0x)* |
| `UnionWith(1, 10000)` | 0.539ms ββ(0.4x) π | 0.227ms ββ(1.1x) | 0.216ms ββ(1.1x) | 0.490ms ββ(0.5x) | 0.214ms ββ(1.1x) π’ | 0.214ms ββ(1.1x) | *0.242ms (1.0x)* |
| `UnionWith(1, 100000)` | 5.532ms ββ(0.5x) π | 2.397ms ββ(1.1x) | 2.465ms ββ(1.1x) | 4.955ms ββ(0.5x) | 2.263ms ββ(1.2x) | 2.242ms ββ(1.2x) π’ | *2.687ms (1.0x)* |
| `UnionWith(1, 1000000)` | 79.156ms ββ(0.6x) π | 41.627ms ββ(1.2x) | 36.230ms ββ(1.4x) | 72.721ms ββ(0.7x) | 36.150ms ββ(1.4x) π’ | 36.708ms ββ(1.3x) | *48.928ms (1.0x)* |
| `IntersectWith(1, 10000)` | 0.318ms ββ(0.9x) π | 0.135ms ββ(2.1x) | 0.118ms ββ(2.4x) | 0.264ms ββ(1.1x) | 0.110ms ββ(2.6x) π’ | 0.112ms ββ(2.5x) | *0.286ms (1.0x)* |
| `IntersectWith(1, 100000)` | 3.460ms ββ(0.9x) π | 1.490ms ββ(2.0x) | 1.322ms ββ(2.2x) | 2.881ms ββ(1.0x) | 1.259ms ββ(2.4x) π’ | 1.280ms ββ(2.3x) | *2.963ms (1.0x)* |
| `IntersectWith(1, 1000000)` | 50.949ms ββ(1.3x) | 18.330ms ββ(3.6x) | 16.081ms ββ(4.1x) | 41.292ms ββ(1.6x) | 15.816ms ββ(4.1x) π’ | 15.828ms ββ(4.1x) | *65.453ms (1.0x)* π |
| `ExceptWith(1, 10000)` | 0.269ms ββ(0.9x) π | 0.213ms ββ(1.1x) | 0.118ms ββ(2.0x) | 0.197ms ββ(1.2x) | 0.115ms ββ(2.0x) | 0.112ms ββ(2.1x) π’ | *0.230ms (1.0x)* |
| `ExceptWith(1, 100000)` | 2.960ms ββ(0.8x) π | 1.408ms ββ(1.8x) | 1.335ms ββ(1.8x) | 2.181ms ββ(1.1x) | 1.320ms ββ(1.9x) | 1.280ms ββ(1.9x) π’ | *2.467ms (1.0x)* |
| `ExceptWith(1, 1000000)` | 40.054ms ββ(1.0x) | 20.188ms ββ(2.0x) | 18.223ms ββ(2.2x) | 30.004ms ββ(1.4x) | 18.972ms ββ(2.2x) | 17.592ms ββ(2.3x) π’ | *40.898ms (1.0x)* π |
*ΒΉ* Optimizations were disabled to perform this benchmark
*Β²* Benchmark run on parallel job workers - results may vary
*Β³* AddGrow(workers, capacity, growTo) -- Incrementally grows from `capacity` until reaching size of `growTo`
---
### *QueueParallelWriter*
| Functionality | NativeQueueParallelWriter (S) | NativeQueueParallelWriter (S+B) | NativeQueueParallelWriter (B) | UnsafeQueueParallelWriter (S) | UnsafeQueueParallelWriter (S+B) | UnsafeQueueParallelWriter (B) | *ConcurrentQueue (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `EnqueueGrow(1, 10000)`*Β³* | 0.063ms ββ(1.8x) | 0.037ms ββ(3.1x) | 0.027ms ββ(4.2x) π’ | --- | --- | --- | *0.112ms (1.0x)* π |
| `EnqueueGrow(2, 10000)`*Β²ΛΒ³* | 0.036ms ββ(3.8x) | 0.032ms ββ(4.3x) | 0.022ms ββ(6.3x) π’ | --- | --- | --- | *0.136ms (1.0x)* π |
| `EnqueueGrow(4, 10000)`*Β²ΛΒ³* | 0.041ms ββ(5.0x) | 0.023ms ββ(9.1x) π’ | 0.028ms ββ(7.4x) | --- | --- | --- | *0.205ms (1.0x)* π |
| `EnqueueGrow(1, 100000)`*Β³* | 1.111ms ββ(1.0x) π | 0.196ms ββ(5.5x) π’ | 0.249ms ββ(4.3x) | --- | --- | --- | *1.069ms (1.0x)* |
| `EnqueueGrow(2, 100000)`*Β²ΛΒ³* | 0.353ms β(43.1x) | 0.129ms (118.3x) π’ | 0.141ms (107.9x) | --- | --- | --- | *15.233ms (1.0x)* π |
| `EnqueueGrow(4, 100000)`*Β²ΛΒ³* | 0.359ms (128.0x) | 0.119ms (384.9x) | 0.101ms (455.1x) π’ | --- | --- | --- | *45.962ms (1.0x)* π |
| `EnqueueGrow(1, 1000000)`*Β³* | 6.964ms ββ(1.5x) | 1.971ms ββ(5.3x) π’ | 2.470ms ββ(4.2x) | --- | --- | --- | *10.493ms (1.0x)* π |
| `EnqueueGrow(2, 1000000)`*Β²ΛΒ³* | 3.587ms ββ(4.2x) | 1.264ms β(12.0x) π’ | 1.353ms β(11.2x) | --- | --- | --- | *15.213ms (1.0x)* π |
| `EnqueueGrow(4, 1000000)`*Β²ΛΒ³* | 3.119ms β(14.9x) | 1.036ms β(44.8x) | 0.915ms β(50.7x) π’ | --- | --- | --- | *46.400ms (1.0x)* π |
| `Enqueue(1, 10000)`*β΄* | 0.063ms ββ(1.8x) | 0.014ms ββ(8.0x) π’ | 0.019ms ββ(5.9x) | --- | --- | --- | *0.112ms (1.0x)* π |
| `Enqueue(2, 10000)`*Β²Λβ΄* | 0.043ms ββ(3.1x) | 0.015ms ββ(8.7x) | 0.013ms β(10.1x) π’ | --- | --- | --- | *0.132ms (1.0x)* π |
| `Enqueue(4, 10000)`*Β²Λβ΄* | 0.036ms ββ(5.7x) | 0.017ms β(11.8x) | 0.016ms β(13.0x) π’ | --- | --- | --- | *0.203ms (1.0x)* π |
| `Enqueue(1, 100000)`*β΄* | 0.628ms ββ(1.7x) | 0.244ms ββ(4.4x) | 0.187ms ββ(5.7x) π’ | --- | --- | --- | *1.068ms (1.0x)* π |
| `Enqueue(2, 100000)`*Β²Λβ΄* | 0.329ms β(46.3x) | 0.142ms (107.6x) | 0.107ms (142.5x) π’ | --- | --- | --- | *15.253ms (1.0x)* π |
| `Enqueue(4, 100000)`*Β²Λβ΄* | 0.305ms (154.5x) | 0.077ms (611.1x) | 0.061ms (767.5x) π’ | --- | --- | --- | *47.086ms (1.0x)* π |
| `Enqueue(1, 1000000)`*β΄* | 6.283ms ββ(1.7x) | 1.374ms ββ(7.6x) π’ | 1.869ms ββ(5.6x) | --- | --- | --- | *10.486ms (1.0x)* π |
| `Enqueue(2, 1000000)`*Β²Λβ΄* | 3.268ms ββ(4.7x) | 0.896ms β(17.0x) π’ | 1.029ms β(14.8x) | --- | --- | --- | *15.201ms (1.0x)* π |
| `Enqueue(4, 1000000)`*Β²Λβ΄* | 2.931ms β(15.8x) | 0.638ms β(72.4x) π’ | 0.697ms β(66.3x) | --- | --- | --- | *46.225ms (1.0x)* π |
*Β²* Benchmark run on parallel job workers - results may vary
*Β³* EnqueueGrow(workers, insertions)
*β΄* Enqueue(workers, insertions)
---
### *Queue*
| Functionality | NativeQueue (S) | NativeQueue (S+B) | NativeQueue (B) | UnsafeQueue (S) | UnsafeQueue (S+B) | UnsafeQueue (B) | *Queue (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(0)`*ΒΉ* | 0.482ms β(0.2x) π | 0.181ms β(0.6x) | 0.161ms β(0.6x) | 0.232ms β(0.4x) | 0.000ms β(334.3x) π’ | 0.000ms β(334.3x) π’ | *0.100ms (1.0x)* |
| `IsEmpty_x_100k(100)`*ΒΉ* | 0.503ms β(0.2x) π | 0.188ms β(0.5x) | 0.141ms β(0.7x) | 0.241ms β(0.4x) | 0.000ms β(334.3x) π’ | 0.000ms β(334.3x) π’ | *0.100ms (1.0x)* |
| `Count_x_100k(0)`*ΒΉ* | 0.313ms β(0.4x) π | 0.193ms β(0.6x) | 0.161ms β(0.7x) | 0.189ms β(0.6x) | 0.000ms β(401.2x) π’ | 0.000ms β(401.2x) π’ | *0.120ms (1.0x)* |
| `Count_x_100k(100)`*ΒΉ* | 0.351ms β(0.3x) π | 0.181ms β(0.7x) | 0.141ms β(0.9x) | 0.231ms β(0.5x) | 0.000ms β(401.2x) π’ | 0.000ms β(343.9x) | *0.120ms (1.0x)* |
| `ToNativeArray(10000)` | 0.003ms β(1.2x) | 0.002ms β(1.7x) | 0.002ms β(1.7x) | 0.002ms β(1.8x) π’ | 0.002ms βββ(1.8x) | 0.002ms βββ(1.8x) π’ | *0.003ms (1.0x)* π |
| `ToNativeArray(100000)` | 0.096ms β(0.3x) π | 0.016ms β(1.9x) | 0.015ms β(1.9x) | 0.089ms β(0.3x) | 0.015ms βββ(1.9x) π’ | 0.015ms βββ(1.9x) | *0.029ms (1.0x)* |
| `ToNativeArray(1000000)` | 0.991ms β(0.8x) π | 0.197ms β(4.1x) | 0.163ms β(5.0x) | 0.897ms β(0.9x) | 0.156ms βββ(5.2x) π’ | 0.161ms βββ(5.0x) | *0.814ms (1.0x)* |
| `EnqueueGrow(10000)`*Β³* | 0.060ms (23.4x) | 0.025ms (57.2x) | 0.024ms (59.1x) π’ | 0.045ms (31.3x) | 0.025ms ββ(56.4x) | 0.026ms ββ(55.1x) | *1.414ms (1.0x)* π |
| `EnqueueGrow(100000)`*Β³* | 0.657ms β(0.6x) π | 0.249ms β(1.6x) | 0.231ms β(1.8x) π’ | 0.445ms β(0.9x) | 0.241ms βββ(1.7x) | 0.248ms βββ(1.6x) | *0.407ms (1.0x)* |
| `EnqueueGrow(1000000)`*Β³* | 6.580ms β(0.6x) π | 2.452ms β(1.6x) | 2.340ms β(1.7x) π’ | 4.509ms β(0.9x) | 2.473ms βββ(1.6x) | 2.509ms βββ(1.6x) | *3.931ms (1.0x)* |
| `Enqueue(10000)`*β΄* | 0.060ms β(0.8x) π | 0.019ms β(2.4x) | 0.018ms β(2.5x) π’ | 0.039ms β(1.2x) | 0.020ms βββ(2.3x) | 0.020ms βββ(2.2x) | *0.046ms (1.0x)* |
| `Enqueue(100000)`*β΄* | 0.599ms β(0.7x) π | 0.193ms β(2.1x) | 0.180ms β(2.3x) π’ | 0.392ms β(1.0x) | 0.198ms βββ(2.1x) | 0.196ms βββ(2.1x) | *0.407ms (1.0x)* |
| `Enqueue(1000000)`*β΄* | 5.989ms β(0.7x) π | 2.048ms β(1.9x) | 1.801ms β(2.2x) π’ | 3.933ms β(1.0x) | 2.010ms βββ(2.0x) | 2.011ms βββ(2.0x) | *3.933ms (1.0x)* |
| `Dequeue(10000)` | 0.066ms β(0.6x) π | 0.025ms β(1.4x) | 0.016ms β(2.4x) π’ | 0.045ms β(0.8x) | 0.017ms βββ(2.2x) | 0.017ms βββ(2.2x) | *0.037ms (1.0x)* |
| `Dequeue(100000)` | 0.664ms β(0.6x) π | 0.248ms β(1.5x) | 0.151ms β(2.4x) π’ | 0.455ms β(0.8x) | 0.158ms βββ(2.3x) | 0.159ms βββ(2.3x) | *0.369ms (1.0x)* |
| `Dequeue(1000000)` | 6.640ms β(0.6x) π | 2.479ms β(1.5x) | 1.503ms β(2.5x) π’ | 4.551ms β(0.8x) | 1.578ms βββ(2.3x) | 1.589ms βββ(2.3x) | *3.690ms (1.0x)* |
| `Peek(10000)`*ΒΉ* | 0.030ms β(0.6x) π | 0.023ms β(0.8x) | 0.014ms β(1.3x) | 0.012ms β(1.5x) | 0.000ms ββ(45.4x) π’ | 0.000ms ββ(45.4x) π’ | *0.018ms (1.0x)* |
| `Peek(100000)`*ΒΉ* | 0.302ms β(0.6x) π | 0.222ms β(0.8x) | 0.134ms β(1.4x) | 0.121ms β(1.5x) | 0.001ms β(278.8x) π’ | 0.001ms β(258.9x) | *0.181ms (1.0x)* |
| `Peek(1000000)`*ΒΉ* | 3.016ms β(0.6x) π | 2.213ms β(0.8x) | 1.369ms β(1.3x) | 1.205ms β(1.5x) | 0.001ms (2127.8x) | 0.001ms (2260.8x) π’ | *1.809ms (1.0x)* |
| `Foreach(10000)` | 0.028ms β(1.5x) | 0.009ms β(4.9x) | 0.007ms β(6.4x) | 0.018ms β(2.3x) | 0.003ms ββ(13.9x) | 0.003ms ββ(14.1x) π’ | *0.042ms (1.0x)* π |
| `Foreach(100000)` | 0.283ms β(1.5x) | 0.082ms β(5.2x) | 0.062ms β(6.9x) | 0.182ms β(2.3x) | 0.027ms ββ(15.5x) π’ | 0.027ms ββ(15.5x) π’ | *0.425ms (1.0x)* π |
| `Foreach(1000000)` | 2.833ms β(1.5x) | 0.812ms β(5.2x) | 0.612ms β(6.9x) | 1.819ms β(2.3x) | 0.267ms ββ(15.9x) | 0.267ms ββ(15.9x) π’ | *4.250ms (1.0x)* π |
*ΒΉ* Optimizations were disabled to perform this benchmark
*Β³* EnqueueGrow(insertions)
*β΄* Enqueue(insertions)
---
### *RingQueue*
| Functionality | NativeRingQueue (S) | NativeRingQueue (S+B) | NativeRingQueue (B) | UnsafeRingQueue (S) | UnsafeRingQueue (S+B) | UnsafeRingQueue (B) | *Queue (BCL)* |
|---|--:|--:|--:|--:|--:|--:|--:|
| `IsEmpty_x_100k(0)`*ΒΉ* | 0.174ms (0.7x) π | 0.108ms (1.1x) π’ | 0.108ms (1.1x) π’ | 0.121ms (1.0x) | 0.111ms (1.1x) | 0.110ms (1.1x) | *0.121ms (1.0x)* |
| `IsEmpty_x_100k(100)`*ΒΉ* | 0.161ms (0.8x) π | 0.108ms (1.1x) | 0.108ms (1.1x) π’ | 0.120ms (1.0x) | 0.111ms (1.1x) | 0.110ms (1.1x) | *0.120ms (1.0x)* |
| `Count_x_100k(0)`*ΒΉ* | 0.192ms (0.5x) π | 0.142ms (0.7x) | 0.108ms (0.9x) | 0.120ms (0.8x) | 0.111ms (0.9x) | 0.111ms (0.9x) | *0.101ms (1.0x)* π’ |
| `Count_x_100k(100)`*ΒΉ* | 0.188ms (0.5x) π | 0.143ms (0.7x) | 0.110ms (0.9x) | 0.120ms (0.8x) | 0.111ms (0.9x) | 0.111ms (0.9x) | *0.100ms (1.0x)* π’ |
| `Enqueue(10000)` | 0.033ms (1.1x) | 0.019ms (1.9x) | 0.018ms (2.0x) | 0.019ms (1.9x) | 0.017ms (2.0x) π’ | 0.018ms (2.0x) | *0.035ms (1.0x)* π |
| `Enqueue(100000)` | 0.331ms (1.1x) | 0.183ms (1.9x) | 0.173ms (2.0x) | 0.182ms (1.9x) | 0.172ms (2.0x) π’ | 0.173ms (2.0x) | *0.349ms (1.0x)* π |
| `Enqueue(1000000)` | 3.311ms (1.1x) | 1.815ms (1.9x) | 1.725ms (2.0x) | 1.823ms (1.9x) | 1.722ms (2.0x) π’ | 1.732ms (2.0x) | *3.477ms (1.0x)* π |
| `Dequeue(10000)` | 0.032ms (1.1x) | 0.017ms (2.1x) | 0.008ms (4.6x) π’ | 0.017ms (2.1x) | 0.017ms (2.1x) | 0.011ms (3.3x) | *0.035ms (1.0x)* π |
| `Dequeue(100000)` | 0.326ms (1.1x) | 0.163ms (2.2x) | 0.072ms (4.9x) π’ | 0.167ms (2.1x) | 0.162ms (2.2x) | 0.102ms (3.5x) | *0.352ms (1.0x)* π |
| `Dequeue(1000000)` | 3.257ms (1.1x) | 1.624ms (2.2x) | 0.708ms (5.0x) π’ | 1.666ms (2.1x) | 1.612ms (2.2x) | 1.008ms (3.5x) | *3.516ms (1.0x)* π |
*ΒΉ* Optimizations were disabled to perform this benchmark
---