2 ms·
1) Did you take frequency scaling into consideration while benchmarking? 2) v8 doesn't make your code blazing fast by default. It has many optimizations but yo
by 29athrowaway 7y ago
1) Did you take frequency scaling into consideration while benchmarking?
2) v8 doesn't make your code blazing fast by default. It has many optimizations but your code may be written in a way that v8 cannot fully optimize.
3) I recommend this tool as an alternative to using "time": https://github.com/sharkdp/hyperfine https://github.com/sharkdp/hyperfine
- BiteCode_dev 7y agoAs stated: "the times varied a lot because my machine is not setup for a clean benchmark" So this is not a benchmark. Just a fun observation of a trend. A proper benchmark would require to have a dedicated machine with no other softwares running, hyperthreading off and run each of them a 100 times, without fs cache. EDIT: gonna edit the original post with hyperfine results.