Commit d268b35
committed
ExtrOcamlZBigInt: Use shifts/masks to build and match
This is particularly valuable for FMapPositive and other structures like stdpp's
Pmap that walk a binary number's encoding, because every walk can now be done
without allocation and without general-purpose division.
Micro-benchmark on OCaml 5.2.1+flambda:
Name Time/Run mWd/Run
FMapPositive.find x100k (stock) 88.04ms 17_403_012w
FMapPositive.find x100k (shift+mask) 57.32ms 6wpositive values1 parent 2bca56e commit d268b35
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
0 commit comments