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.0M gary: 781k gle: 2.9M list: 3.8M dict: 1.7M
100 iv: 172k gary: 73.1k gle: 112k list: 808k dict: 96.8k
1000 iv: 17.8k gary: 5945 gle: 1308 list: 91.7k dict: 9725
10k iv: 2041 gary: 498 gle: 13 list: 9274 dict: 607
100k iv: 203 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 the center
N ivy gary glearray list dict
10 iv: 206 gary: 9.44 gle: 1051 list: 221 dict: 13.5
100 iv: 253 gary: 7.94 gle: 896 list: 189 dict: 11.3
1000 iv: 211 gary: 2.72 gle: 367 list: 72.6 dict: 3.83
10k iv: 148 gary: n/a gle: 53.2 list: 10.2 dict: n/a
100k iv: 119 gary: n/a gle: 5.52 list: 1.10 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: 3281 gary: 5406 gle: 1294 list: 534 dict: 7810
100 iv: 4166 gary: 5816 gle: 1102 list: 458 dict: 7151
1000 iv: 3901 gary: 4987 gle: 446 list: 185 dict: 6839
10k iv: 3040 gary: 4184 gle: 64.2 list: 26.3 dict: 5376
100k iv: 2505 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: 1856 gary: 11.5 gle: 1269 dict: 7780
100 iv: 1911 gary: 9.73 gle: 1080 dict: 7380
1000 iv: 1659 gary: 3.34 gle: 448 dict: 6864
10k iv: 1559 gary: n/a gle: 64.4 dict: 5383
100k iv: 1371 gary: n/a gle: 5.76 dict: 3870
  • iv
  • gary
  • glearray
  • dict

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 the center
N ivy gary glearray list dict
10 iv: 11057 gary: 8818 gle: 13938 list: 7332 dict: 13394
100 iv: 7293 gary: 6374 gle: 4769 list: 1072 dict: 8574
1000 iv: 5564 gary: 4696 gle: 569 list: 102 dict: 6257
10k iv: 4402 gary: 4183 gle: 58.0 list: 9.24 dict: 5294
100k iv: 3626 gary: 3612 gle: 5.72 list: 0.88 dict: 4642
  • iv
  • gary
  • glearray
  • list
  • dict
get 1k elements at the center
N ivy gary glearray list dict
10 iv: 44048 gary: 16232 gle: 39230 list: 34863 dict: 26966
100 iv: 26950 gary: 13670 gle: 39732 list: 8783 dict: 21410
1000 iv: 23603 gary: 10649 gle: 39726 list: 942 dict: 18506
10k iv: 19716 gary: 10650 gle: 39850 list: 98.8 dict: 17601
100k iv: 16928 gary: 9532 gle: 38817 list: 10.1 dict: 19670
  • iv
  • gary
  • glearray
  • list
  • dict
iterate (map)
N ivy gary glearray list dict
10 iv: 5.0M gary: 2.0M gle: 1.3M list: 2.8M dict: 1.5M
100 iv: 1.2M gary: 286k gle: 76.6k list: 571k dict: 102k
1000 iv: 153k gary: 28.4k gle: 1087 list: 61.5k dict: 8194
10k iv: 16k gary: 3131 gle: 11.4 list: 6391 dict: 674
100k iv: 1590 gary: 317 gle: n/a list: 621 dict: 56.7
  • iv
  • gary
  • glearray
  • list
  • dict
Search Document