Ask HN: How do you benchmark your programming languages?
During the development of my tiny (less than 4k LoC) virtual machine, I continuously measured how long it took to execute recursive fibonacci function (fib(40)) as a way to estimate how performant it is.
What other benchmarks do you use for your programming languages?
5 comments
[ 3.2 ms ] story [ 25.1 ms ] threadhttps://benchmarksgame-team.pages.debian.net/benchmarksgame/...
I haven't implemented any language / VM of my own, but when I write a library then even for very specialized purposes I often write several tests when I want to be on the safe side as far as performance goes (correctness being the more important concern most of the time). Also, I typically want to have tests involving other libraries (or other VMs in your case) to get an idea of how fast I am in comparison, otherwise I'd be stuck with oh wow 1000 times doing something takes just under a moment kind of wisdom.
* it's not a very good one either, because a sensible implementation won't be recursive in many current languages
* even if it's faster it's just 1 case so it doesn't speak for the language as a a hole set of possibilities; it's a bit as though the Python people were all like, hey look, our hello world runs 1.6 times faster than when using language Y!! It's just not convincing.
* your goal may be to beat other languages for this particular use case, then that's fine, most people won't be interested in your language if that's the case, but of course you do you