Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function outer(x) {
var y;
for (var i = 0; i < 10000000; i++) {
y = inner();
}
function inner() {
return x;
}
return inner();
}
while(true) {
var start = Date.now();
outer("test");
print(Date.now() - start, "millis");
}
### Rhino HEAD output
2220 millis
1846 millis
1796 millis
1859 millis
1862 millis
1860 millis
1861 millis
1874 millis
1857 millis
1858 millis
### Rhino-opt companion-scopes branch
288 millis
244 millis
199 millis
205 millis
155 millis
237 millis
150 millis
152 millis
157 millis
152 millis
### V8 (snapshot from last summer, new one didn't build)
88 millis
86 millis
89 millis
88 millis
87 millis
88 millis
88 millis
89 millis
87 millis
88 millis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment