Benchmarks
Benchmarks were run using Gleam 1.8, Erlang/OTP-27.1.2 on Windows 11 and an AMD Ryzen 7 PRO 5850U.
The numbers are instructions per second (IPS). Higher is better.
The goal of iv
is to provide consistent, reliable performance across all kinds of workloads.
create from list
N |
ivy |
gary |
glearray |
list |
dict |
10 |
iv: 1.5M |
gary: 781k |
gle: 2.9M |
list: 3.8M |
dict: 1.7M |
100 |
iv: 215k |
gary: 73.1k |
gle: 112k |
list: 808k |
dict: 96.8k |
1000 |
iv: 19.3k |
gary: 5945 |
gle: 1308 |
list: 91.7k |
dict: 9725 |
10k |
iv: 2003 |
gary: 498 |
gle: 13 |
list: 9274 |
dict: 607 |
100k |
iv: 222 |
gary: 41 |
gle: n/a |
list: 925 |
dict: 32 |
- iv
- gary
- glearray
- list
- dict
For lists, the provided numbers are the performance of the baseline list.range
call.
insert 1k elements at random positions
N |
ivy |
gary |
glearray |
list |
dict |
10 |
iv: 162 |
gary: 9.76 |
gle: 1088 |
list: 254 |
dict: 14.5 |
100 |
iv: 153 |
gary: 9.37 |
gle: 959 |
list: 215 |
dict: 12.3 |
1000 |
iv: 120 |
gary: 3.34 |
gle: 417 |
list: 88.1 |
dict: 4.62 |
10k |
iv: 82 |
gary: n/a |
gle: 64.3 |
list: 12.9 |
dict: n/a |
100k |
iv: 56 |
gary: n/a |
gle: 5.84 |
list: 1.26 |
dict: n/a |
- iv
- gary
- glearray
- list
- dict
Note: Only iv
and glearray
provide native insert algorithms. Others where implemented by copying the existing array, with the new item added.
append 1k elements
N |
ivy |
gary |
glearray |
list |
dict |
10 |
iv: 3238 |
gary: 5406 |
gle: 1294 |
list: 534 |
dict: 7810 |
100 |
iv: 3237 |
gary: 5816 |
gle: 1102 |
list: 458 |
dict: 7151 |
1000 |
iv: 2934 |
gary: 4987 |
gle: 446 |
list: 185 |
dict: 6839 |
10k |
iv: 2298 |
gary: 4184 |
gle: 64.2 |
list: 26.3 |
dict: 5376 |
100k |
iv: 1912 |
gary: 3545 |
gle: 5.85 |
list: 2.40 |
dict: 3859 |
- iv
- gary
- glearray
- list
- dict
prepend 1k elements
N |
ivy |
gary |
glearray |
dict |
10 |
iv: 1336 |
gary: 11.5 |
gle: 1269 |
dict: 7780 |
100 |
iv: 1325 |
gary: 9.73 |
gle: 1080 |
dict: 7380 |
1000 |
iv: 1151 |
gary: 3.34 |
gle: 448 |
dict: 6864 |
10k |
iv: 1089 |
gary: n/a |
gle: 64.4 |
dict: 5383 |
100k |
iv: 1058 |
gary: n/a |
gle: 5.76 |
dict: 3870 |
Note: lists where excluded to make the chart more readable. Lists provide constant prepends regardless of list size. I was able to achieve 44.2k IPS using lists in this benchmark.
set 1k elements at random positions
N |
ivy |
gary |
glearray |
list |
dict |
10 |
iv: 5080 |
gary: 4526 |
gle: 5686 |
list: 4379 |
dict: 5067 |
100 |
iv: 4268 |
gary: 4017 |
gle: 3717 |
list: 1110 |
dict: 4166 |
1000 |
iv: 3687 |
gary: 3554 |
gle: 615 |
list: 131 |
dict: 3750 |
10k |
iv: 3173 |
gary: 3078 |
gle: 66.1 |
list: 13.4 |
dict: 3071 |
100k |
iv: 2579 |
gary: 2528 |
gle: 6.80 |
list: 1.28 |
dict: 1930 |
- iv
- gary
- glearray
- list
- dict
get 1k elements at random positions
N |
ivy |
gary |
glearray |
list |
dict |
10 |
iv: 7180 |
gary: 5658 |
gle: 6885 |
list: 6368 |
dict: 5820 |
100 |
iv: 5542 |
gary: 5311 |
gle: 6828 |
list: 4324 |
dict: 6350 |
1000 |
iv: 6437 |
gary: 5257 |
gle: 7100 |
list: 1029 |
dict: 6140 |
10k |
iv: 6036 |
gary: 5033 |
gle: 6252 |
list: 125 |
dict: 5728 |
100k |
iv: 5335 |
gary: 4398 |
gle: 6002 |
list: 12.1 |
dict: 3138 |
- iv
- gary
- glearray
- list
- dict
iterate (fold)
N |
ivy |
gary |
glearray |
list |
dict |
10 |
iv: 4.5M |
gary: 3.5M |
gle: 2.4M |
list: 4.3M |
dict: 2.5M |
100 |
iv: 2.7M |
gary: 655k |
gle: 372k |
list: 1.0M |
dict: 288k |
1000 |
iv: 357k |
gary: 71.7k |
gle: 38.8k |
list: 125k |
dict: 26.2k |
10k |
iv: 37.7k |
gary: 7177 |
gle: 3114 |
list: 12.6k |
dict: 2177 |
100k |
iv: 3705 |
gary: 712 |
gle: 395 |
list: 1249 |
dict: 60 |
- iv
- gary
- glearray
- list
- dict