4 ms·
It would probably be prudent to strip comments before measuring the code sizes: I did not check all files, but noticed that the simple rust code consists of ab
by optionalsquid 4y ago
It would probably be prudent to strip comments before measuring the code sizes:
I did not check all files, but noticed that the simple rust code consists of about 60% comments (in terms of bytes), mostly due to a verbose blurb. It also spends about 15% of the non-comment bytes on printing nicer error messages, which is an interesting choice for a micro-benchmark. The simple C and FORTH versions similarly have a lot of comments.
Meanwhile a lot of the other files have very few or no comments.
- burntsushi 4y agoI wrote the Rust version and the comments are a reflection of my style and my belief that benchmarks should come with some kind of analysis. The "simple" variant was also intended to demonstrate idiomatic code without a bunch of perf tricks. Nicer error messages in that case is fair game. Indeed, a naively analysis based on code size without taking comments into account is pretty obviously wrong.