https://github.com/playerx/nodejs-cpp-binding
https://github.com/playerx/nodejs-cpp-binding
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/playerx/nodejs-cpp-binding
- Owner: playerx
- Created: 2020-07-28T20:54:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-29T18:56:46.000Z (almost 6 years ago)
- Last Synced: 2025-01-19T22:42:02.036Z (over 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Goals
This demo project had multiple goals:
1. Demonstrate how to write custom C++ Binding for Nodejs using Napi and call it from Javascript
2. See how much performance overhead it takes to call pure empty function in C++ and return the result back to Javascript
## Requirements
- [Nodejs](https://nodejs.org/en/download/)
## How to run
1. `npm i`
2. `npm start`
## Performance
Hardware:
```
MacBook Pro (Retina, 15-inch, Mid 2014)
2.2 GHz Quad-Core Intel Core i7
16 GB 1600 MHz DDR3
```
```
100000 Iterations
```
**Result:**
1 custom (sync) op call duration
| Avg | Fastest |
| ----- | ------- |
| 341ns | 246ns |
## Related
[deno-rust-plugin](https://github.com/playerx/deno-rust-plugin)