-
This library replaces |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
There are performance issues with process.nextTick and the accompanying node::MakeCallback but that's not the primary reason they are swapped (we only gain maybe 7% from doing this). This project is a standalone V8 runtime - you can compile it as a standalone binary that runs on its own very much like Deno and Node.js itself. This project cannot depend on anything Node.js, and has to replace all parts that are very tied to only Node.js. Basically anything inside node:: namespace is strictly forbidden here. process.nextTick is one such thing as it enforces a particular way C++ must call JS via (node::MakeCallback). Now, the project is standalone but it can also work as a Node.js addon, where it has to swap out process.nextTick to even work with other Node.js libraries. |
Beta Was this translation helpful? Give feedback.
-
It is possible to make it 100% identical in behavior but that is not an issue for now |
Beta Was this translation helpful? Give feedback.
-
This will make adoption of this amazing project very easy for Nodejs developers. |
Beta Was this translation helpful? Give feedback.
-
@alexhultman I found an issue in the Node.js issue tracker where you discussed some of the differences. I did not check how much Node.js improved since then but as you care about performance, what about improving the some code directly in Node.js core? That way even more people would benefit by it. |
Beta Was this translation helpful? Give feedback.
-
I experimented with the thought back in 2016 and I even proposed working for StrongLoop back then but nobody wanted me to. Pretty much since day 1 I have gotten the cold hand from Node.js "core" programmers. They are very territorial and with very fragile egos, you can't bring up anything negative must pretend everything is fine. I've been banned from Node.js repo since 2016 👍 Besides, I get more exposure as an outsider doing my own thing. |
Beta Was this translation helpful? Give feedback.
-
@BridgeAR Hey I'm actually just now testing a new much simpler implementation:
This actually works identically to process.nextTick by relying on the native V8 microtask queue (the one managing async/await/Promises) and this simple thing makes everything compatible only relying on this setting:
With this setting V8 will automatically run all queued up Promises and async/await on return from JS, wheter being inside Node.js or in the addon. This removes a lot of hacks on my end and it seems to work just fine, and performance is really good. |
Beta Was this translation helpful? Give feedback.
There are performance issues with process.nextTick and the accompanying node::MakeCallback but that's not the primary reason they are swapped (we only gain maybe 7% from doing this).
This project is a standalone V8 runtime - you can compile it as a standalone binary that runs on its own very much like Deno and Node.js itself. This project cannot depend on anything Node.js, and has to replace all parts that are very tied to only Node.js. Basically anything inside node:: namespace is strictly forbidden here.
process.nextTick is one such thing as it enforces a particular way C++ must call JS via (node::MakeCallback).
Now, the project is standalone but it can also work as a Node.js addon, whe…