Open jiribenes opened 1 week ago
It seems that this change makes Valgrind very unhappy with the LLVM backend :)
https://github.com/effekt-lang/effekt/actions/runs/11990743350/job/33428584571#step:11:164
I tried improving both the performance and the stack safety here by making certain parts (mergeAll
) more imperative, but it didn't really work (actually made it measurably slower!)
In a "real" application (and by that I mean AoC), this change saves 25-50% of the run time:
Before
✓ 1: JS [6.44ms]
✓ 2: JS [103.46ms]
✓ 1: LLVM [0.27ms]
✓ 2: LLVM [17.80ms]
After
✓ 1: JS [5.66ms]
✓ 2: JS [80.25ms]
✓ 1: LLVM [0.12ms]
✓ 2: LLVM [8.72ms]
Please see issue #710 for context and analysis. (Resolves #710)
It would be nice if somebody benchmarked this properly: the old quicksort, this new quicksort on JS and LLVM + with JS native sort, but I can notice the improvement as this version can suddenly quickly sort huge random lists.
Other considerations:
compare
everywhere manually.>=
instead of a>