|
|
|
|
|
by nmaludy
182 days ago
|
|
If i'm understanding the repository correctly, it looks like each language reads from a file, does some I/O printing to console, then computes the value, then some more console printing and exits. In my opinion, the comparisons could be better if the file I/O and console printing were removed. |
|
My Python version is a good example of the structure: read rounds.txt, run the loop, print the result, exit. I’m timing the whole program with hyperfine.
I agree that for a “pure compute” microbenchmark you could remove file I/O and console output. I kept them mainly because:
- It gives every language the same simple interface (same input, same output) and acts as a basic correctness/sanity check.
- The benchmark runs 1 billion iterations. The file read and a single print happen once per run, so that overhead is tiny compared to the loop, and the results stay comparable in practice.
That said, I’m not against a compute-only / quiet mode. Since hyperfine already handles timing externally, the real work is implementing and maintaining a consistent --quiet / --no-io variant across 50+ languages.
If someone wants to contribute that (even starting with a subset), I’m happy to review PRs.