Skip to content

Instantly share code, notes, and snippets.

@YassineBajdou
Created August 1, 2018 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YassineBajdou/e9252c51c67938517e1daa62bfffbbbe to your computer and use it in GitHub Desktop.
Save YassineBajdou/e9252c51c67938517e1daa62bfffbbbe to your computer and use it in GitHub Desktop.
(() => {
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