Skip to content

Instantly share code, notes, and snippets.

@shisama
Last active December 16, 2019 16:31
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 shisama/f82d767c378e668e0bac276f7a3a8f03 to your computer and use it in GitHub Desktop.
Save shisama/f82d767c378e668e0bac276f7a3a8f03 to your computer and use it in GitHub Desktop.
const start = performance.now();
interface Member {
name: string;
birthday?: Date;
url?: string;
instrument?: string;
}
const john: Member = {
name: 'John Lennon',
url: 'www.johnlennon.com',
};
const paul: Member = {
name: 'Paul McCartney',
birthday: new Date('1942-06-18'),
};
const george: Member = {
name: 'George Harrison',
instrument: 'guitar',
};
const ringo: Member = {
name: 'Ringo Starr'
};
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
// 1713.5850000195205
// 1712.8449999727309
// 1678.5799999488518
// Firefox 69
// 46693
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment