RedPRL / ocaml-bwd

🔙 Backward lists for OCaml
https://ocaml.org/p/bwd
Apache License 2.0
19 stars 2 forks source link

🗞️ Unrolling? #22

Closed favonia closed 10 months ago

favonia commented 10 months ago

I'm not sure if this is worth it, but I'll document it here anyways. The standard library is currently 2-unrolling a few functions, which means it fuses two recursive calls into one. The main reason is to match the performance, thanks to the careful benchmarking of @nojb. The relevant functions are:

I haven't done the unrolling because the potential 20% slow-down on short lists hasn't become a bottleneck yet, but maybe we should do it when more people are using this library.