benchmark: pre-optimize url.parse() before start
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 9 Dec 2014 22:26:24 +0000 (23:26 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Fri, 19 Dec 2014 22:10:31 +0000 (23:10 +0100)
commit1a63b45a2a32b3df60118518bf22171b81b89ba9
treed801372e45a4804fab070ee3674c91bc60ddc09b
parentc4a308d223e2796b6af77213abb8f3dd5e31e67f
benchmark: pre-optimize url.parse() before start

Force V8 to optimize url.parse() before starting the actual benchmark.
Tries to minimize variance between successive runs caused by the
optimizer kicking in at different points.

It does not seem to have much impact, CPU times are roughly the same
before and afterwards; url.parse() quickly plateaus at a local optimum
where most time is spent in V8 builtins, notably Runtime_StringSplit()
and Object::GetElementWithReceiver() calls originating from
deps/v8/src/uri.js, with no recurring optimize/deoptimize cycles that
I could spot.

Still, I don't see any downsides to pre-optimizing the function being
benchmarked so in it goes.

PR-URL: https://github.com/iojs/io.js/pull/132
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
benchmark/url/url.js