Skip to content

Instantly share code, notes, and snippets.

@paulgb
Created July 28, 2023 02:00
Show Gist options
  • Save paulgb/588e3657115fcefe1b1a51990f59e5a8 to your computer and use it in GitHub Desktop.
Save paulgb/588e3657115fcefe1b1a51990f59e5a8 to your computer and use it in GitHub Desktop.
js iterator benchmark
let m = {}
for (let i = 0; i < 50_000_000; i++) { m[i] = i }
let start = performance.now()
for (const _ in m) {
break
}
console.log(performance.now() - start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment