Skip to content

Commit

Permalink
napi: Performance optimizations (nodejs#134)
Browse files Browse the repository at this point in the history
 - 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
jasongin authored Mar 9, 2017
1 parent 47b3ca0 commit 1cce8c7
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 75 deletions.
Loading

0 comments on commit 1cce8c7

Please sign in to comment.