Created
November 7, 2017 11:16
-
-
Save anonymous/cb64256134fb6354ce8e0b94d4a2e490 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
var process_copy = Object.assign({}, process); | |
var process_ref = process; | |
process_copy.env = Object.assign({}, process.env); | |
var lab1 = 'normal process.env'; | |
var lab2 = 'process copy env'; | |
console.time(lab1); | |
var no_discard = false; | |
for(var i = 0; i < 1e7; i++) { | |
no_discard = no_discard || (process_ref.env.NODE_ENV == Math.random()); | |
} | |
console.timeEnd(lab1); | |
console.time(lab2) | |
for(var i = 0; i < 1e7; i++) { | |
no_discard = no_discard || (process_copy.env.NODE_ENV == Math.random()); | |
} | |
console.timeEnd(lab2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment