Last active
December 16, 2019 16:30
-
-
Save shisama/686434d41ea77bdda11cea2a6c441681 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 start = performance.now(); | |
interface Member { | |
name: string; | |
birthday: Date | null; | |
url: string | null; | |
instrument: string | null; | |
} | |
const john: Member = { | |
name: 'John Lennon', | |
url: 'www.johnlennon.com', | |
birthday: null, | |
instrument: null, | |
}; | |
const paul: Member = { | |
name: 'Paul McCartney', | |
birthday: new Date('1942-06-18'), | |
url: null, | |
instrument: null, | |
}; | |
const george: Member = { | |
name: 'George Harrison', | |
url: null, | |
instrument: 'guitar', | |
birthday: null, | |
}; | |
const ringo: Member = { | |
name: 'Ringo Starr', | |
birthday: null, | |
url: null, | |
instrument: null, | |
}; | |
const beatles = [john, paul, george, ringo]; | |
for (var i = 0; i < 1000 * 1000 * 1000; i++) { | |
beatles[i & 3].name; | |
} | |
const end = performance.now(); | |
console.log(end - start); | |
// V8 7.9.317.31 | |
// 1475.5349999666214 | |
// 1462.2949999719858 | |
// 1462.2949999719858 | |
// Firefox 69 | |
// 45857 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment