Rust Native Module with Node-API
summary
Shows building a native Node module with Node-API and Rust (examples using neon / napi bindings), compiling a Fibonacci function into a native add-on and comparing runtimes: pure JavaScript 22 seconds versus the native module ~6.4 seconds, roughly a quarter of the time. Describes using prebuild tooling to avoid recompiles across Node versions, cautions about bridge overhead (minimize crossings and data copies), and recommends keeping most logic in JS unless heavy compute justifies native code.
AI-written summary · about
chapters (9)
- 0:00Introduction to talk
- 2:28Why use native modules
- 12:16When to avoid native modules
- 17:35Challenges with Node-API
- 20:49Evolution to Node-API
- 23:41Rust for native modules
- 24:41Performance demo comparison
- 27:33Tips for Node-API usage
- 28:57Q&A and closing
related talks
30mPumping up Node js modules with Rust!
55mNode.js N-API for Rust
25mIntroduction to native extensions
31mN-API: The Next Generation Node.js API is Ready!
26mN-API - next generation Node API for native modules
31mBuilding Modern Native Add-ons for Node.js in 2021
27mBuilding Ultra-Low Latency APIs in Node.js with Native Modules and Worker Threads
28mN-API - The new native in node.js
