Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
napi: Performance optimizations (nodejs#134)
- Add a `napi_get_cb_info` function to get args length, args, this, and data in a single call - Move the static exception to a class member to enable inlining of the `lastException()` method. - Refactor the `CallbackWrapper` group of helper classes to avoid most (non-inlinable) virtual function calls - Remove use of `v8::TryCatch` (via `NAPI_PREAMBLE`) from several places where it shouldn't be needed. Together, these optimizations reduce the overhead of every JS-to-C++ call through the NAPI layer by approximately 50%.
- Loading branch information