Skip to content

Instantly share code, notes, and snippets.

@bengl
Last active August 10, 2017 22:21
Show Gist options
  • Save bengl/4a3951b68b7be4151aac4a3d1fb58005 to your computer and use it in GitHub Desktop.
Save bengl/4a3951b68b7be4151aac4a3d1fb58005 to your computer and use it in GitHub Desktop.
// Try running this file in Node 8.2.1
// Try running this file in Node 8.3.0
// Try running this file in d8 for Node 8.3.0
function empty() {}
let i, j, d;
for(j = 0; j < 5; j++) {
d = Date.now();
for (i = 0; i < 1e7; i++) {
empty();
}
console.log(j, 0, Date.now() - d);
d = Date.now();
for (i = 0; i < 1e7; i++) {
empty();
}
console.log(j, 1, Date.now() - d);
d = Date.now();
for (i = 0; i < 1e7; i++) {
empty();
}
console.log(j, 2, Date.now() - d);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment