TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you benchmark your programming languages?

3 pointsby xqb64over 1 year ago
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.<p>What other benchmarks do you use for your programming languages?

2 comments

npalliover 1 year ago
If you are using fibonacci to test out performance in the small, you might want to stick with the Computer Language Benchmark Game. It gives you the universe of languages and sample programs to you can see what works best with your VM.<p><a href="https:&#x2F;&#x2F;benchmarksgame-team.pages.debian.net&#x2F;benchmarksgame&#x2F;index.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;benchmarksgame-team.pages.debian.net&#x2F;benchmarksgame&#x2F;...</a>
评论 #38517505 未加载
DemocracyFTW2over 1 year ago
Using a single function, and then recursive Fibonacci of all, is certainly not enough to give estimates about The Language. Everyone should know that although recursive Fibonacci is like that one poster function that comes right after Hello World it is not a recommended implementation strategy for that functionality in most languages (but of course if you can make it run as fast as the linearized version that would be a good thing).<p>I haven&#x27;t implemented any language &#x2F; 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 <i>in comparison</i>, otherwise I&#x27;d be stuck with <i>oh wow 1000 times doing something takes just under a moment</i> kind of wisdom.
评论 #38517499 未加载