Last active
February 20, 2016 23:10
-
-
Save summivox/47cfa0947e855995c002 to your computer and use it in GitHub Desktop.
manage-arguments does NOT work
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
4.6.85.31 | |
Function is not optimized | |
Function is not optimized | |
Function is not optimized | |
Function is optimized |
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
npm i v8-natives manage-arguments |
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
// Generated by LiveScript 1.4.0 | |
(function(){ | |
var v8, MA, S, fs, i$, len$, f, slice$ = [].slice; | |
v8 = require('v8-natives'); | |
MA = require('manage-arguments'); | |
S = function(it){ | |
var i$, x$, len$, results$ = []; | |
for (i$ = 0, len$ = it.length; i$ < len$; ++i$) { | |
x$ = it[i$]; | |
results$.push(x$); | |
} | |
return results$; | |
}; | |
fs = [ | |
function(){ | |
var a; | |
a = slice$.call(arguments); | |
return a.sort(); | |
}, function(){ | |
var x; | |
x = MA(arguments); | |
return x.sort(); | |
}, function(){ | |
var x; | |
x = S(arguments); | |
return x.sort(); | |
}, function(){ | |
var x, res$, i$, x$, len$; | |
res$ = []; | |
for (i$ = 0, len$ = arguments.length; i$ < len$; ++i$) { | |
x$ = arguments[i$]; | |
res$.push(x$); | |
} | |
x = res$; | |
return x.sort(); | |
} | |
]; | |
console.log(v8.getV8Version()); | |
for (i$ = 0, len$ = fs.length; i$ < len$; ++i$) { | |
f = fs[i$]; | |
v8.helpers.testOptimization(f); | |
} | |
}).call(this); |
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
require! { | |
'v8-natives': v8 | |
'manage-arguments': MA | |
} | |
S = -> [.. for it] | |
fs = [ | |
(...a) -> a.sort! | |
-> | |
x = MA arguments | |
x.sort! | |
-> | |
x = S arguments | |
x.sort! | |
-> | |
x = [.. for arguments] | |
x.sort! | |
] | |
console.log v8.getV8Version! | |
for f in fs => v8.helpers.testOptimization f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment