Created
August 1, 2018 07:59
-
-
Save YassineBajdou/0ed5c5e1feba9c85fa6eeb3310f1a7a7 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 han = {firstname: "Han", lastname: "Solo"}; | |
const luke = {firstname: "Luke", lastname: "Skywalker"}; | |
const leia = {firstname: "Leia", lastname: "Organa"}; | |
const obi = {firstname: "Obi", lastname: "Wan"}; | |
const yoda = {firstname: "", lastname: "Yoda"}; | |
const people = [ | |
han, luke, leia, obi, | |
yoda, luke, leia, obi | |
]; | |
const getName = (person) => person.lastname; | |
console.time("engine"); | |
for(var i = 0; i < 1000 * 1000 * 1000; i++) { | |
getName(people[i & 7]); | |
} | |
console.timeEnd("engine"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment