niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

Minor tweaks #16

Closed pedrosakuma closed 1 year ago

pedrosakuma commented 1 year ago

IO

Some programming languages in the test may be ahead of each other due to more efficient implementation of io. It would be beneficial to measure only the calculation.

Other

If possible, do many iterations to have a bigger sample, and also, to mitigate the penalty that languages that depends on JIT have on warmup

niklas-heer commented 1 year ago

Hi @pedrosakuma

Thank you for your thoughts on this repo.

Regarding IO: The main point of using this is due to convince of being able to set the number of rounds for all languages in one file. The secondary point is that it's also a common use-case. Thus, I think it is OK to make this tradeoff. I also wouldn't use the results of this repo to determine if a language is better or even faster than another in general. I only test a very narrow use-case with the floating-point calculation.

Regarding Other: I'm not quite sure what you are referring to with "iterations". There are two: inside the file (rounds) and command iterations.

Inside the file: Currently, rounds.txt sets the number of rounds for the calculation of Pi to 1000000. What would be a better number in your mind? Command iterations: Increasing the iterations of executing commands would help JIT languages, since it stops after every iteration.

-- What do you think?

frak0d commented 1 year ago

@niklas-heer i would recommend passing the number of rounds as a command line argument instead of a file.

niklas-heer commented 1 year ago

@0xB00B I can see your point, but I don't see a big enough benefit for a refactor of that size. I think a one-time read operation of a file is quite reasonable. Like a config file.