chore: bump dev-deps, toolchain, disable benchmarks#494
Conversation
Made-with: Cursor
Benchmark ResultsWARNING: dfx is deprecated, use icp-cli https://cli.internetcomputer.org. LLM skills can be found at https://skills.internetcomputer.org/llms.txt bench/ArrayBuilding.bench.mo
|
| 1000 | 100000 | 1000000 | |
|---|---|---|---|
| List | 542_124 |
47_994_218 |
475_069_964 |
| Buffer | 341_984 |
33_903_378 |
339_003_575 |
| pure/List | 209_110 |
20_703_488 |
207_055_893 |
| VarArray ?T | 172_496 |
17_002_890 |
170_003_087 |
| VarArray T | 160_791 |
15_803_185 |
158_003_382 |
| Array (baseline) | 42_669 |
4_003_063 |
40_003_260 |
Heap
| 1000 | 100000 | 1000000 | |
|---|---|---|---|
| List | 272 B |
272 B |
272 B |
| Buffer | 272 B |
272 B |
272 B |
| pure/List | 272 B |
272 B |
272 B |
| VarArray ?T | 272 B |
272 B |
272 B |
| VarArray T | 272 B |
272 B |
272 B |
| Array (baseline) | 272 B |
272 B |
272 B |
Garbage Collection
| 1000 | 100000 | 1000000 | |
|---|---|---|---|
| List | 9.96 KiB |
797.46 KiB |
7.67 MiB |
| Buffer | 8.71 KiB |
782.15 KiB |
7.63 MiB |
| pure/List | 19.95 KiB |
1.91 MiB |
19.07 MiB |
| VarArray ?T | 8.24 KiB |
781.68 KiB |
7.63 MiB |
| VarArray T | 8.23 KiB |
781.67 KiB |
7.63 MiB |
| Array (baseline) | 4.3 KiB |
391.02 KiB |
3.82 MiB |
bench/Base64.bench.mo $({\color{gray}0\%})$
Base64
Compare zero bytes vs mixed bytes encoding to Base64
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| zero bytes | mixed bytes | |
|---|---|---|
| 1 | 927 | 927 |
| 10 | 3_179 | 3_179 |
| 100 | 22_364 | 22_364 |
| 1000 | 214_214 | 214_214 |
| 10000 | 2_132_755 | 2_132_755 |
Heap
| zero bytes | mixed bytes | |
|---|---|---|
| 1 | 272 B | 272 B |
| 10 | 272 B | 272 B |
| 100 | 272 B | 272 B |
| 1000 | 272 B | 272 B |
| 10000 | 272 B | 272 B |
Garbage Collection
| zero bytes | mixed bytes | |
|---|---|---|
| 1 | 344 B | 344 B |
| 10 | 496 B | 496 B |
| 100 | 1.77 KiB | 1.77 KiB |
| 1000 | 14.66 KiB | 14.66 KiB |
| 10000 | 143.57 KiB | 143.57 KiB |
bench/FromIters.bench.mo $({\color{green}-18.12\%})$
Benchmarking the fromIter functions
Columns describe the number of elements in the input iter.
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| 100 | 10_000 | 100_000 | |
|---|---|---|---|
| Array.fromIter | 44_209 |
4_252_070 |
42_503_138 |
| List.fromIter | 24_963 |
2_381_606 |
23_803_617 |
| List.fromIter . Iter.reverse | 39_158 |
3_712_583 |
37_105_496 |
Heap
| 100 | 10_000 | 100_000 | |
|---|---|---|---|
| Array.fromIter | 272 B |
272 B |
272 B |
| List.fromIter | 272 B |
272 B |
272 B |
| List.fromIter . Iter.reverse | 272 B |
272 B |
272 B |
Garbage Collection
| 100 | 10_000 | 100_000 | |
|---|---|---|---|
| Array.fromIter | 2.76 KiB |
234.79 KiB |
2.29 MiB |
| List.fromIter | 3.51 KiB |
312.88 KiB |
3.05 MiB |
| List.fromIter . Iter.reverse | 5.11 KiB |
469.17 KiB |
4.58 MiB |
bench/ListBufferNewArray.bench.mo $({\color{green}-9.33\%})$
List vs. Buffer for creating known-size arrays
Performance comparison between List and Buffer for creating a new array.
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| 0 (baseline) | 1 | 5 | 10 | 100 (for loop) | |
|---|---|---|---|---|---|
| List | 1_431 |
2_751 |
8_731 |
13_525 |
73_225 |
| pure/List | 1_311 |
1_328 |
2_039 |
2_935 |
22_627 |
| Buffer | 2_185 |
2_337 |
3_584 |
5_150 |
36_703 |
Heap
| 0 (baseline) | 1 | 5 | 10 | 100 (for loop) | |
|---|---|---|---|---|---|
| List | 272 B |
272 B |
272 B |
272 B |
272 B |
| pure/List | 272 B |
272 B |
272 B |
272 B |
272 B |
| Buffer | 272 B |
272 B |
272 B |
272 B |
272 B |
Garbage Collection
| 0 (baseline) | 1 | 5 | 10 | 100 (for loop) | |
|---|---|---|---|---|---|
| List | 476 B |
516 B |
676 B |
784 B |
1.84 KiB |
| pure/List | 360 B |
380 B |
460 B |
560 B |
2.3 KiB |
| Buffer | 856 B |
864 B |
896 B |
936 B |
1.62 KiB |
bench/PriorityQueues.bench.mo $({\color{green}-3.52\%})$
Different priority queue implementations
_Compare the performance of the following priority queue implementations:
-
PriorityQueue: Binary heap implementation overList. -
PriorityQueueSet: Wrapper overSet<(T, Nat)>._
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| A) PriorityQueue | B) PriorityQueueSet | |
|---|---|---|
| 1.) 100000 operations (push:pop = 1:1) | 568_912_967 |
512_819_534 |
| 2.) 100000 operations (push:pop = 2:1) | 707_495_313 |
794_441_406 |
| 3.) 100000 operations (push:pop = 10:1) | 336_409_528 |
861_119_552 |
| 4.) 100000 operations (only push) | 176_982_741 |
876_145_673 |
| 5.) 50000 pushes, then 50000 pops | 745_226_483 |
942_202_387 |
| 6.) 50000 pushes, then 25000 "pop;push"es | 504_254_116 |
906_644_478 |
Heap
| A) PriorityQueue | B) PriorityQueueSet | |
|---|---|---|
| 1.) 100000 operations (push:pop = 1:1) | 272 B |
272 B |
| 2.) 100000 operations (push:pop = 2:1) | 272 B |
272 B |
| 3.) 100000 operations (push:pop = 10:1) | 272 B |
272 B |
| 4.) 100000 operations (only push) | 272 B |
272 B |
| 5.) 50000 pushes, then 50000 pops | 272 B |
272 B |
| 6.) 50000 pushes, then 25000 "pop;push"es | 272 B |
272 B |
Garbage Collection
| A) PriorityQueue | B) PriorityQueueSet | |
|---|---|---|
| 1.) 100000 operations (push:pop = 1:1) | 15.07 MiB |
17.43 MiB |
| 2.) 100000 operations (push:pop = 2:1) | 19.73 MiB |
19.32 MiB |
| 3.) 100000 operations (push:pop = 10:1) | 8.67 MiB |
12.64 MiB |
| 4.) 100000 operations (only push) | 3.87 MiB |
9.96 MiB |
| 5.) 50000 pushes, then 50000 pops | 22.03 MiB |
26.2 MiB |
| 6.) 50000 pushes, then 25000 "pop;push"es | 14.22 MiB |
18.44 MiB |
bench/PureListStackSafety.bench.mo $({\color{green}-34.14\%})$
List Stack safety
Check stack-safety of the following pure/List-related functions.
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| pure/List.split | 15_502_639 |
| pure/List.all | 5_701_079 |
| pure/List.any | 5_801_455 |
| pure/List.map | 14_003_792 |
| pure/List.filter | 12_204_214 |
| pure/List.filterMap | 17_804_766 |
| pure/List.partition | 12_205_020 |
| pure/List.join | 21_905_353 |
| pure/List.flatten | 13_605_695 |
| pure/List.take | 15_505_779 |
| pure/List.drop | 7_804_212 |
| pure/List.foldRight | 12_205_838 |
| pure/List.merge | 20_408_449 |
| pure/List.chunks | 35_910_420 |
| pure/Queue | 112_662_773 |
Heap
| pure/List.split | 272 B |
| pure/List.all | 272 B |
| pure/List.any | 272 B |
| pure/List.map | 272 B |
| pure/List.filter | 272 B |
| pure/List.filterMap | 272 B |
| pure/List.partition | 272 B |
| pure/List.join | 272 B |
| pure/List.flatten | 272 B |
| pure/List.take | 272 B |
| pure/List.drop | 272 B |
| pure/List.foldRight | 272 B |
| pure/List.merge | 272 B |
| pure/List.chunks | 272 B |
| pure/Queue | 272 B |
Garbage Collection
| pure/List.split | 3.05 MiB |
| pure/List.all | 328 B |
| pure/List.any | 328 B |
| pure/List.map | 3.05 MiB |
| pure/List.filter | 3.05 MiB |
| pure/List.filterMap | 3.05 MiB |
| pure/List.partition | 3.05 MiB |
| pure/List.join | 3.05 MiB |
| pure/List.flatten | 3.05 MiB |
| pure/List.take | 3.05 MiB |
| pure/List.drop | 328 B |
| pure/List.foldRight | 1.53 MiB |
| pure/List.merge | 4.58 MiB |
| pure/List.chunks | 7.63 MiB |
| pure/Queue | 18.31 MiB |
bench/Queues.bench.mo $({\color{green}-10.78\%})$
Different queue implementations
Compare the performance of the following queue implementations:
-
pure/Queue: The default immutable double-ended queue implementation.- Pros: Good amortized performance, meaning that the average cost of operations is low
O(1). - Cons: In worst case, an operation can take
O(size)time rebuilding the queue as demonstrated in thePop front 2 elementsscenario.
- Pros: Good amortized performance, meaning that the average cost of operations is low
-
pure/RealTimeQueue- Pros: Every operation is guaranteed to take at most
O(1)time and space. - Cons: Poor amortized performance: Instruction cost is on average 3x for pop and 8x for push compared to
pure/Queue.
- Pros: Every operation is guaranteed to take at most
- mutable
Queue- Pros: Also
O(1)guarantees with a lower constant factor thanpure/RealTimeQueue. Amortized performance is comparable topure/Queue. - Cons: It is mutable and cannot be used in
sharedtypes (not shareable).
- Pros: Also
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| pure/Queue | pure/RealTimeQueue | mutable Queue | |
|---|---|---|---|
| Initialize with 2 elements | 2_846 |
2_368 |
3_001 |
| Push 500 elements | 79_279 |
678_272 |
187_811 |
| Pop front 2 elements | 52_879 |
4_385 |
3_830 |
| Pop 150 front&back | 71_206 |
269_482 |
109_955 |
Heap
| pure/Queue | pure/RealTimeQueue | mutable Queue | |
|---|---|---|---|
| Initialize with 2 elements | 324 B |
300 B |
352 B |
| Push 500 elements | 8.08 KiB |
8.17 KiB |
19.8 KiB |
| Pop front 2 elements | 240 B |
240 B |
192 B |
| Pop 150 front&back | -4.42 KiB |
-492 B |
-11.45 KiB |
Garbage Collection
| pure/Queue | pure/RealTimeQueue | mutable Queue | |
|---|---|---|---|
| Initialize with 2 elements | 508 B |
444 B |
456 B |
| Push 500 elements | 10.1 KiB |
137.84 KiB |
344 B |
| Pop front 2 elements | 12.19 KiB |
528 B |
424 B |
| Pop 150 front&back | 15.61 KiB |
49.66 KiB |
12.1 KiB |
bench/Sort.bench.mo $({\color{gray}0\%})$
Sort
VarArray.sortInPlace profiling
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| 100 | 1000 | 10000 | 12000 | 100000 | 1000000 | |
|---|---|---|---|---|---|---|
| old-sort | 205_451 | 2_681_815 | 35_810_320 | 43_067_826 | 442_387_549 | 5_046_582_599 |
| new-sort | 72_460 | 1_123_218 | 16_084_225 | 19_445_600 | 201_432_925 | 2_423_397_103 |
Heap
| 100 | 1000 | 10000 | 12000 | 100000 | 1000000 | |
|---|---|---|---|---|---|---|
| old-sort | 272 B | 272 B | 272 B | 272 B | 272 B | 308 B |
| new-sort | 272 B | 272 B | 272 B | 272 B | 272 B | 308 B |
Garbage Collection
| 100 | 1000 | 10000 | 12000 | 100000 | 1000000 | |
|---|---|---|---|---|---|---|
| old-sort | 736 B | 4.23 KiB | 39.39 KiB | 47.2 KiB | 390.95 KiB | 3.82 MiB |
| new-sort | 536 B | 2.28 KiB | 19.86 KiB | 23.77 KiB | 195.64 KiB | 1.91 MiB |
Note: Renamed benchmarks cannot be compared. Refer to the current baseline for manual comparison.
Benchmark pipeline is broken; disable automatic runs but keep manual trigger. Made-with: Cursor
test2.1.2,bench2.0.1) and toolchain (wasmtime44.0.0).mops.lock.workflow_dispatch).