This seems to stand in the old field of abiding by the letter of the law without adhering to the spirit of the law - I’ve always wondered how they could get away with this, and what provisions could prevent bad practice like this, if any without significant burden.
For fun, I tried it with another language that uses LLVM: Zig 0.4.0.
I’m still waiting on the release build; it’s making my laptop sweaty.
I really just feel like this should be extrapolated as a stress test for every language, just for fun.
Time taken on a 2013 MacBook Pro:
(the executable is apparently 23m)
It’s time to introduce un-unroll optimizations!
Loop rolling!
Hmm! Interesting results. An obvious reduction, but not as big of one as I would have thought.
The disassembly is a disaster, and looks something like:
not that it would make a difference for this benchmark but 0.5.0 was released on monday
This seems to stand in the old field of abiding by the letter of the law without adhering to the spirit of the law - I’ve always wondered how they could get away with this, and what provisions could prevent bad practice like this, if any without significant burden.