Couple of things I found interesting:
> 2: Time.now is an expensive function that takes a while to execute and typically requires control transfer to a VDSO. (On my older laptop this takes 800+ nanos to run. On more expensive server class machines, I have seen numbers as low as 40 nanos.)
Then there is system noise for which you still need a large sample size, and the result has a high variation and we haven't still accounted for GC.
So they do this:
> This brings us to how Core_bench works: Core_bench runs f in increasing batch sizes and reports the estimated time of f () by doing a linear regression. In the simplest case, the linear regression uses execution time as the predicted variable and batch size as the predictor. Several useful properties follow as a consequence...
While we're on the topic of benchmarking, what is the best way to to do micro-benchmarks for Javascript code (both Node and browser)? I tried node --prof, but the report is a little difficult to parse. Chrome's performance tab would've been helpful, but it doesn't seem to profile WebWorkers.
> 2: Time.now is an expensive function that takes a while to execute and typically requires control transfer to a VDSO. (On my older laptop this takes 800+ nanos to run. On more expensive server class machines, I have seen numbers as low as 40 nanos.)
Then there is system noise for which you still need a large sample size, and the result has a high variation and we haven't still accounted for GC.
So they do this:
> This brings us to how Core_bench works: Core_bench runs f in increasing batch sizes and reports the estimated time of f () by doing a linear regression. In the simplest case, the linear regression uses execution time as the predicted variable and batch size as the predictor. Several useful properties follow as a consequence...
While we're on the topic of benchmarking, what is the best way to to do micro-benchmarks for Javascript code (both Node and browser)? I tried node --prof, but the report is a little difficult to parse. Chrome's performance tab would've been helpful, but it doesn't seem to profile WebWorkers.