languages
languages copied to clipboard
Zig arrays to be stack-allocated
I have:
- [x] Read the project README, including the benchmark descriptions
Description of changes
To be closer to the C or Fortran versions, use stack-allocated arrays in the Zig version instead of dynamically heap-allocated arrays, providing more accurate results.
you should also remove the std.mem.eql at the top of levehenstein. C version isn't doing that. also I don't believe the benchmark is comparing eql strings anyway, so you're just doing more work without payout.
See this comment on why the arrays are heap allocated.
In order to be able to use arbitrary input sizes, stack-allocated arrays at comptime with fixed sizes are no longer an option.