Skip to content

Instantly share code, notes, and snippets.

@wreckah
Created September 12, 2019 17:07
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 wreckah/e50d58d8c6e44966dbebee626138dc56 to your computer and use it in GitHub Desktop.
Save wreckah/e50d58d8c6e44966dbebee626138dc56 to your computer and use it in GitHub Desktop.
Node.js try-catch perf
> console.time(); for (let i=0, j; i<1000000; i++) j++; console.timeEnd();
default: 10.310ms
> console.time(); for (let i=0, j; i<1000000; i++) try {j++} catch (e) {}; console.timeEnd();
default: 10.577ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment