Skip to content

perf: reduce JS wrapper overhead and fix EventEmitter inheritance#116

Open
cesco69 wants to merge 2 commits intobrianc:masterfrom
cesco69:patch-2
Open

perf: reduce JS wrapper overhead and fix EventEmitter inheritance#116
cesco69 wants to merge 2 commits intobrianc:masterfrom
cesco69:patch-2

Conversation

@cesco69
Copy link
Contributor

@cesco69 cesco69 commented Dec 16, 2025

  • remove unnecessary JS indirection layers
  • alias native methods directly on prototype

@brianc
Copy link
Owner

brianc commented Mar 5, 2026

I like the setPrototype simply because it's more built in, but are you sure this does anything for performance? V8 is extremely good at inlining small functions like this and having this indirection layer allows for a nice place to patch in if something needs to be done in JS land. I would be pretty surprised if this adds overhead. If it does and you have benchmarks to show it I'll happily merge this though!

@cesco69
Copy link
Contributor Author

cesco69 commented Mar 5, 2026

It's just a micro-optimization. See this benchmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants