Get the latest tech news

Microbenchmarks Are Experiments


Wake up babe, new microbenchmark just dropped! More languages, more insights!— Ben Dicken (@BenjDicken) November 25, 2024 A few interesting takeaways: * Java and Kotlin are quick! Possible explanation: Google is heavily invested in performance here. * Js is really fast as far as interpreted / jit languages go.

JavaScript version is: The code is slightly modified compared to the original to make it directly runnable in JavaScriptCore shell: console.log became print and process.argv[2] became arguments[0] Compiler noticed that it has a[i] value flowing on all edges and eliminated a[i] load inside the loop:You might be tempted to try combining Int64List change with a[i]; hint but that would not work. In reality compiler should really try to perform this optimization itself: I have occasionally encountered hot loops (e.g. lexer keeping a character position in a field) where it would be really beneficial.

Get the Android app

Or read this on Hacker News