Skip to content

Instantly share code, notes, and snippets.

@odino
Created April 15, 2018 17:49
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 odino/aa4217db4041fe3e6e95b0c29a82055f to your computer and use it in GitHub Desktop.
Save odino/aa4217db4041fe3e6e95b0c29a82055f to your computer and use it in GitHub Desktop.
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