diff --git a/test/DotRecast.Benchmark/Benchmarks/PriorityQueueBenchmarks.cs b/test/DotRecast.Benchmark/Benchmarks/PriorityQueueBenchmarks.cs index c4f1757..b929454 100644 --- a/test/DotRecast.Benchmark/Benchmarks/PriorityQueueBenchmarks.cs +++ b/test/DotRecast.Benchmark/Benchmarks/PriorityQueueBenchmarks.cs @@ -7,44 +7,51 @@ namespace DotRecast.Benchmark.Benchmarks; /* -| Method | Count | Mean | Error | StdDev | Median | -| ---------------------- | --------- | ---------------: | ---------------: | ---------------: | ---------------: | -| **Enqueue_rcQueue** | **10** | **83.81 ns** | **1.722 ns** | **2.925 ns** | **83.00 ns** | -| Enqueue_heap | 10 | 173.27 ns | 3.431 ns | 3.813 ns | 172.40 ns | -| Enqueue_pqueue | 10 | 151.13 ns | 3.045 ns | 3.625 ns | 151.81 ns | -| DequeueAll_rcQueue | 10 | 293.28 ns | 5.368 ns | 5.021 ns | 293.56 ns | -| DequeueAll_heap | 10 | 409.89 ns | 4.982 ns | 4.416 ns | 410.04 ns | -| DequeueAll_pqueue | 10 | 448.56 ns | 4.490 ns | 3.980 ns | 448.17 ns | -| EnqueueDequeue_rcQueue | 10 | 116.73 ns | 0.126 ns | 0.105 ns | 116.72 ns | -| EnqueueDequeue_heap | 10 | 130.94 ns | 0.936 ns | 0.781 ns | 130.80 ns | -| EnqueueDequeue_pqueue | 10 | 101.39 ns | 0.589 ns | 0.551 ns | 101.14 ns | -| **Enqueue_rcQueue** | **100** | **690.10 ns** | **1.463 ns** | **1.297 ns** | **689.74 ns** | -| Enqueue_heap | 100 | 2,517.08 ns | 8.466 ns | 7.070 ns | 2,515.99 ns | -| Enqueue_pqueue | 100 | 2,188.55 ns | 26.386 ns | 24.682 ns | 2,193.53 ns | -| DequeueAll_rcQueue | 100 | 4,862.85 ns | 71.216 ns | 59.469 ns | 4,849.71 ns | -| DequeueAll_heap | 100 | 8,791.09 ns | 145.019 ns | 183.403 ns | 8,731.62 ns | -| DequeueAll_pqueue | 100 | 10,819.65 ns | 97.138 ns | 90.863 ns | 10,837.05 ns | -| EnqueueDequeue_rcQueue | 100 | 1,123.50 ns | 10.281 ns | 9.114 ns | 1,119.03 ns | -| EnqueueDequeue_heap | 100 | 1,228.70 ns | 4.664 ns | 3.894 ns | 1,227.22 ns | -| EnqueueDequeue_pqueue | 100 | 968.43 ns | 19.095 ns | 30.834 ns | 963.56 ns | -| **Enqueue_rcQueue** | **1000** | **7,416.73 ns** | **147.213 ns** | **229.193 ns** | **7,377.16 ns** | -| Enqueue_heap | 1000 | 35,362.30 ns | 478.398 ns | 447.494 ns | 35,391.69 ns | -| Enqueue_pqueue | 1000 | 24,861.28 ns | 438.919 ns | 389.091 ns | 24,737.34 ns | -| DequeueAll_rcQueue | 1000 | 81,520.39 ns | 299.823 ns | 250.366 ns | 81,538.01 ns | -| DequeueAll_heap | 1000 | 150,237.95 ns | 475.349 ns | 371.121 ns | 150,241.44 ns | -| DequeueAll_pqueue | 1000 | 166,375.18 ns | 1,105.089 ns | 1,033.701 ns | 166,338.45 ns | -| EnqueueDequeue_rcQueue | 1000 | 10,984.87 ns | 44.043 ns | 41.198 ns | 10,985.13 ns | -| EnqueueDequeue_heap | 1000 | 14,047.62 ns | 174.581 ns | 163.303 ns | 14,061.52 ns | -| EnqueueDequeue_pqueue | 1000 | 9,105.53 ns | 90.691 ns | 80.395 ns | 9,102.35 ns | -| **Enqueue_rcQueue** | **10000** | **90,623.51 ns** | **1,526.788 ns** | **1,353.458 ns** | **90,429.58 ns** | -| Enqueue_heap | 10000 | 347,060.71 ns | 4,511.258 ns | 3,767.105 ns | 347,319.53 ns | -| Enqueue_pqueue | 10000 | 287,118.46 ns | 3,091.524 ns | 2,581.562 ns | 286,254.88 ns | -| DequeueAll_rcQueue | 10000 | 1,245,536.36 ns | 7,701.471 ns | 6,827.153 ns | 1,245,206.25 ns | -| DequeueAll_heap | 10000 | 1,935,679.51 ns | 2,327.083 ns | 1,816.833 ns | 1,935,649.51 ns | -| DequeueAll_pqueue | 10000 | 2,541,652.37 ns | 7,807.705 ns | 7,303.332 ns | 2,543,812.50 ns | -| EnqueueDequeue_rcQueue | 10000 | 121,456.00 ns | 2,210.749 ns | 5,079.562 ns | 119,552.48 ns | -| EnqueueDequeue_heap | 10000 | 144,426.41 ns | 2,700.978 ns | 2,526.496 ns | 143,537.16 ns | -| EnqueueDequeue_pqueue | 10000 | 102,263.93 ns | 984.973 ns | 873.153 ns | 102,031.01 ns | +// * Summary * +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3958/23H2/2023Update/SunValley3) +AMD Ryzen 5 3600, 1 CPU, 12 logical and 6 physical cores +.NET SDK 8.0.101 + [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2 + DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2 + +| Method | Count | Mean | Error | StdDev | +|------------------------------- |------ |--------------------:|-----------------:|-----------------:| +| Enqueue_RcSortedQueue | 10 | 87.49 ns | 0.774 ns | 0.724 ns | +| Enqueue_RcBinaryMinHeap | 10 | 185.23 ns | 1.730 ns | 1.533 ns | +| Enqueue_PriorityQueue | 10 | 202.95 ns | 1.611 ns | 1.428 ns | +| DequeueAll_RcSortedQueue | 10 | 460.97 ns | 2.169 ns | 2.029 ns | +| DequeueAll_RcBinaryMinHeap | 10 | 573.17 ns | 2.542 ns | 2.378 ns | +| DequeueAll_PriorityQueue | 10 | 500.68 ns | 2.364 ns | 2.212 ns | +| EnqueueDequeue_RcSortedQueue | 10 | 525.43 ns | 1.842 ns | 1.632 ns | +| EnqueueDequeue_RcBinaryMinHeap | 10 | 455.65 ns | 2.410 ns | 2.254 ns | +| EnqueueDequeue_PriorityQueue | 10 | 381.82 ns | 6.036 ns | 5.646 ns | +| Enqueue_RcSortedQueue | 100 | 730.57 ns | 5.229 ns | 4.635 ns | +| Enqueue_RcBinaryMinHeap | 100 | 3,012.15 ns | 10.875 ns | 9.640 ns | +| Enqueue_PriorityQueue | 100 | 2,306.80 ns | 26.694 ns | 23.663 ns | +| DequeueAll_RcSortedQueue | 100 | 6,241.67 ns | 31.856 ns | 29.798 ns | +| DequeueAll_RcBinaryMinHeap | 100 | 13,692.29 ns | 38.829 ns | 34.421 ns | +| DequeueAll_PriorityQueue | 100 | 12,482.93 ns | 93.955 ns | 87.886 ns | +| EnqueueDequeue_RcSortedQueue | 100 | 64,002.79 ns | 316.081 ns | 280.197 ns | +| EnqueueDequeue_RcBinaryMinHeap | 100 | 8,655.79 ns | 23.703 ns | 22.172 ns | +| EnqueueDequeue_PriorityQueue | 100 | 7,806.20 ns | 105.801 ns | 98.967 ns | +| Enqueue_RcSortedQueue | 1000 | 7,566.23 ns | 149.010 ns | 218.418 ns | +| Enqueue_RcBinaryMinHeap | 1000 | 36,277.43 ns | 96.710 ns | 90.462 ns | +| Enqueue_PriorityQueue | 1000 | 28,564.19 ns | 186.866 ns | 174.795 ns | +| DequeueAll_RcSortedQueue | 1000 | 108,574.26 ns | 745.459 ns | 697.303 ns | +| DequeueAll_RcBinaryMinHeap | 1000 | 210,346.25 ns | 332.478 ns | 311.000 ns | +| DequeueAll_PriorityQueue | 1000 | 189,536.32 ns | 1,180.045 ns | 1,046.079 ns | +| EnqueueDequeue_RcSortedQueue | 1000 | 8,957,965.42 ns | 45,715.567 ns | 42,762.370 ns | +| EnqueueDequeue_RcBinaryMinHeap | 1000 | 131,615.02 ns | 394.216 ns | 368.750 ns | +| EnqueueDequeue_PriorityQueue | 1000 | 114,799.89 ns | 1,269.621 ns | 1,060.191 ns | +| Enqueue_RcSortedQueue | 10000 | 77,143.76 ns | 996.372 ns | 932.007 ns | +| Enqueue_RcBinaryMinHeap | 10000 | 417,620.57 ns | 853.343 ns | 756.466 ns | +| Enqueue_PriorityQueue | 10000 | 278,791.68 ns | 1,566.093 ns | 1,464.924 ns | +| DequeueAll_RcSortedQueue | 10000 | 1,435,539.99 ns | 9,329.910 ns | 8,727.204 ns | +| DequeueAll_RcBinaryMinHeap | 10000 | 2,956,366.90 ns | 6,344.030 ns | 5,934.210 ns | +| DequeueAll_PriorityQueue | 10000 | 2,642,186.54 ns | 9,482.374 ns | 8,869.819 ns | +| EnqueueDequeue_RcSortedQueue | 10000 | 1,318,277,320.00 ns | 6,725,701.525 ns | 6,291,225.379 ns | +| EnqueueDequeue_RcBinaryMinHeap | 10000 | 1,712,170.68 ns | 5,674.513 ns | 5,307.943 ns | +| EnqueueDequeue_PriorityQueue | 10000 | 1,466,910.77 ns | 4,394.686 ns | 4,110.792 ns | */