Created
June 22, 2015 19:02
-
-
Save paulfryzel/a0e5c8ff31a101990840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function foo(a, b, c) { | |
return 0; | |
} | |
function Obj() {}; | |
Obj.prototype.wrap = function(a, b, c) { | |
return foo.call(this, a, b, c); | |
} | |
var RUNS = 1e6; | |
var o = new Obj(); | |
(function a0() { | |
var start = Date.now(); | |
for (var i = 0; i < RUNS; i++) o.wrap(); | |
print((Date.now() - start) / 1000, 's'); | |
})(); | |
(function a1() { | |
var start = Date.now(); | |
for (var i = 0; i < RUNS; i++) o.wrap(1); | |
print((Date.now() - start) / 1000, 's'); | |
})(); | |
(function a3() { | |
var start = Date.now(); | |
for (var i = 0; i < RUNS; i++) o.wrap(1, 2); | |
print((Date.now() - start) / 1000, 's'); | |
})(); | |
(function a4() { | |
var start = Date.now(); | |
for (var i = 0; i < RUNS; i++) o.wrap(1, 2, 3); | |
print((Date.now() - start) / 1000, 's'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ../vendor/v8/out/native/d8 --trace_hydrogen --trace_phase=Z --trace_deopt --code_comments --hydrogen_track_positions --print_opt_code pwqeth04y.js Concurrent recompilation has been disabled for tracing. [removing optimized code for: a0] 0.006 s [removing optimized code for: a1] 0.004 s [removing optimized code for: a3] 0.003 s [removing optimized code for: a4] 0.003 s