Benchmarks
Adam's benchmark kernels built at each optimization level, timed beside their C twins (clang -O2). x = Adam time / C time: lower is better, 1.00 is C.
- adam
- 0.2.0
- CPU
- 12th Gen Intel(R) Core(TM) i5-12400F
- Threads
- 12
- OS
- Windows 10.0.26300
- Memory
- 32 GB
- Method
- best of 5 runs x 3 processes per kernel
x86_64-windows-gnu
debug
x3.09
geometric mean vs C
safe
x1.51
geometric mean vs C
best
fast
x1.34
geometric mean vs C
small
x1.53
geometric mean vs C
Best level: fast at x1.34 of C.
✓ every checksum matches C at every level
debug
safe
fast
small
Kernels (microseconds)
| Kernel | C | debug | x | safe | x | fast | x | small | x | Check |
|---|---|---|---|---|---|---|---|---|---|---|
| fib | 4952 | 8147 | 1.65 | 8290 | 1.67 | 5541 | 1.12 | 8103 | 1.64 | ✓ |
| sieve | 34450 | 95123 | 2.76 | 48639 | 1.41 | 42393 | 1.23 | 65842 | 1.91 | ✓ |
| sort | 147218 | 298179 | 2.03 | 221346 | 1.50 | 192086 | 1.30 | 211997 | 1.44 | ✓ |
| matmul | 2832 | 16335 | 5.77 | 8570 | 3.03 | 5171 | 1.83 | 5320 | 1.88 | ✓ |
| nbody | 63131 | 150634 | 2.39 | 59681 | 0.95 | 59865 | 0.95 | 60108 | 0.95 | ✓ |
| strings | 66850 | 529843 | 7.93 | 108255 | 1.62 | 107709 | 1.61 | 122480 | 1.83 | ✓ |
| cvt | 20219 | 40958 | 2.03 | 20438 | 1.01 | 20227 | 1.00 | 20597 | 1.02 | ✓ |
| spill | 35600 | 72337 | 2.03 | 41323 | 1.16 | 41134 | 1.16 | 47532 | 1.34 | ✓ |
| pressure | 122140 | 495172 | 4.05 | 122215 | 1.00 | 122062 | 1.00 | 122046 | 1.00 | ✓ |
| alloc | 113589 | 876425 | 7.72 | 200666 | 1.77 | 167726 | 1.48 | 198156 | 1.74 | ✓ |
| collections | 25258 | 63514 | 2.51 | 48652 | 1.93 | 46086 | 1.82 | 49667 | 1.97 | ✓ |
| closures | 15863 | 65608 | 4.14 | 27364 | 1.73 | 27028 | 1.70 | 27642 | 1.74 | ✓ |
| generics | 72658 | 240493 | 3.31 | 160097 | 2.20 | 126522 | 1.74 | 179910 | 2.48 | ✓ |
| parallel | 2293 | 3811 | 1.66 | 2898 | 1.26 | 2861 | 1.25 | 2894 | 1.26 | ✓ |
Builds
| Level | Build (ms) | Exe (bytes) |
|---|---|---|
| debug | 843 | 839 168 |
| safe | 890 | 175 104 |
| fast | 968 | 204 800 |
| small | 813 | 141 824 |
x86_64-linux-gnu
debug
x3.09
geometric mean vs C
safe
x1.43
geometric mean vs C
best
fast
x1.27
geometric mean vs C
small
x1.50
geometric mean vs C
Best level: fast at x1.27 of C.
✓ every checksum matches C at every level
debug
safe
fast
small
Kernels (microseconds)
| Kernel | C | debug | x | safe | x | fast | x | small | x | Check |
|---|---|---|---|---|---|---|---|---|---|---|
| fib | 5206 | 7505 | 1.44 | 7688 | 1.48 | 5848 | 1.12 | 7715 | 1.48 | ✓ |
| sieve | 33819 | 96201 | 2.84 | 42723 | 1.26 | 42153 | 1.25 | 65446 | 1.94 | ✓ |
| sort | 146816 | 294600 | 2.01 | 207107 | 1.41 | 196872 | 1.34 | 208239 | 1.42 | ✓ |
| matmul | 3143 | 16809 | 5.35 | 8300 | 2.64 | 5363 | 1.71 | 5494 | 1.75 | ✓ |
| nbody | 63922 | 155585 | 2.43 | 55336 | 0.87 | 55869 | 0.87 | 60156 | 0.94 | ✓ |
| strings | 39342 | 429511 | 10.92 | 60781 | 1.54 | 57860 | 1.47 | 81406 | 2.07 | ✓ |
| cvt | 20248 | 40513 | 2.00 | 18522 | 0.91 | 18592 | 0.92 | 20137 | 0.99 | ✓ |
| spill | 44978 | 66880 | 1.49 | 47652 | 1.06 | 45444 | 1.01 | 63699 | 1.42 | ✓ |
| pressure | 154392 | 456063 | 2.95 | 141162 | 0.91 | 141187 | 0.91 | 142448 | 0.92 | ✓ |
| alloc | 41086 | 639209 | 15.56 | 116640 | 2.84 | 83617 | 2.04 | 115049 | 2.80 | ✓ |
| collections | 24602 | 57225 | 2.33 | 43026 | 1.75 | 37996 | 1.54 | 40532 | 1.65 | ✓ |
| closures | 16968 | 56487 | 3.33 | 22496 | 1.33 | 20907 | 1.23 | 21141 | 1.25 | ✓ |
| generics | 71342 | 241751 | 3.39 | 159994 | 2.24 | 122297 | 1.71 | 164758 | 2.31 | ✓ |
| parallel | 2533 | 4357 | 1.72 | 3207 | 1.27 | 2956 | 1.17 | 3021 | 1.19 | ✓ |
Builds
| Level | Build (ms) | Exe (bytes) |
|---|---|---|
| debug | 797 | 918 096 |
| safe | 875 | 232 784 |
| fast | 984 | 258 312 |
| small | 782 | 201 936 |
Measured by adam 0.2.0 with adam bench. Every release ships the suite in res/bench: run it on your own machine.