Last active
February 27, 2021 15:51
-
-
Save matsumana/958d8d61f450658c3cfa93758389c507 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
const f = () => { | |
const arr = new Array(); | |
for (let i = 0; i < 1000000; i++) { | |
arr.push((Math.random() * 100) | 0); | |
} | |
let sum = 0; | |
for (let i = 0; i < arr.length; i++) { | |
const value = arr[i]; | |
sum += value; | |
} | |
} | |
for (let i = 0; i < 9999; i++) f(); | |
// $ time out/x64.release/d8 --print-opt-code --code-comments TestCode1.js > tc1.code | |
// out/x64.release/d8 --print-opt-code --code-comments TestCode1.js > tc1.code 184.06s user 36.83s system 105% cpu 3:30.02 total |
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
const f = () => { | |
const arr = new Array(); | |
for (let i = 0; i < 1000000; i++) { | |
arr.push((Math.random() * 100) | 0); | |
} | |
let sum = 0; | |
for (let i = 0; i < 1000000; i++) { | |
const value = arr[i]; | |
sum += value; | |
} | |
} | |
for (let i = 0; i < 9999; i++) f(); | |
// $ time out/x64.release/d8 --print-opt-code --code-comments TestCode2.js > tc2.code | |
// out/x64.release/d8 --print-opt-code --code-comments TestCode2.js > tc2.code 184.69s user 36.32s system 105% cpu 3:30.13 total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment