Created
August 1, 2018 08:01
-
-
Save YassineBajdou/e9252c51c67938517e1daa62bfffbbbe 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", | |
spacecraft: "Falcon"}; | |
const luke = { | |
firstname: "Luke", lastname: "Skywalker", | |
job: "Jedi"}; | |
const leia = { | |
firstname: "Leia", lastname: "Organa", | |
gender: "female"}; | |
const obi = { | |
firstname: "Obi", lastname: "Wan", | |
retired: true}; | |
const yoda = {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