Skip to content

Playground on how I added custom error to v8

I want to improve custom error creation, there is a performance hit as soon as you do:

class MyCustomError extends Error {}

like major hit, from 1M to 600K for creation

If I define the error inside v8:exception there is no performance hit at all, see this changes how I added it, but do you guys know if I can add it using v8 public API?

Opened an issue in v8 to see if there is a way to add custom errors using v8 public API: https://bugs.chromium.org/p/v8/issues/detail?id=14718

Merge request reports

Loading