-
-
Save odino/aa4217db4041fe3e6e95b0c29a82055f 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
let m = new DumbMap() | |
m.set('x', 1) | |
m.set('y', 2) | |
console.time('with very few records in the map') | |
m.get('I_DONT_EXIST') | |
console.timeEnd('with very few records in the map') | |
m = new DumbMap() | |
for (x = 0; x < 1000000; x++) { | |
m.set(`element${x}`, x) | |
} | |
console.time('with lots of records in the map') | |
m.get('I_DONT_EXIST') | |
console.timeEnd('with lots of records in the map') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment