Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kanongil
Copy link
Contributor

The main aim of this PR is to apply a hack that dramatically speeds up standard Bounce.rethrow(err, 'system') calls (when not matching).

This is done by adding a hidden property to each system error prototype, which can be tested for quickly. This replaces a series of slow instanceof checks. In my quick benchmark, I saw a ~50x speed increase!

Care has been taken to implement this in a compatible manner, since system errors with custom [Symbol.hasInstance] logic could otherwise fail. Since none of the existing system errors currently does this, I have had to add one such error during testing, to retain coverage.

@kanongil kanongil added the feature New functionality or improvement label Aug 28, 2025
Copy link

@damusix damusix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid

@kanongil kanongil mentioned this pull request Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants