3 ms·
> [...], written in TypeScript and accelerated with C++ bindings to BLAS and LAPACK C++ addons for Node.js are not part of the JavaScript runtime.
by aastronaut 3y ago
> [...], written in TypeScript and accelerated with C++ bindings to BLAS and LAPACK
C++ addons for Node.js are not part of the JavaScript runtime.
- revskill 3y agoBut it still blocks event loop ?
- byteofbits 3y agoNative bindings can use libuv to offboard work to other threads and then re trigger the JS execution when it completes. This is how a lot of the native node libraries work under the hood to allow parallel IO operations! It’s also an incredibly powerful performance optimisation tool in more complex, scale out NodeJS deployments.
- revskill 3y agoSo in theory, if we ported python libraries into JS, the performance could be better than Python ?
- byteofbits 3y agoAt work we do some pretty significant parallelised computation (using Node and Rust) and that has equivalent performance to a relevant python based library. There are nuances to how data enters and exits the VM runtime which means I couldn’t say with confidence if performance would be better or worse in the general case - but either direction is at least technically viable.
- NickChasanis 3y agoi was thinking about that, seems like a good deal overall with limited overhead.
- pjmlp 3y agoPython bindings for native libraries would still be the same, they are the same native libraries, while pure Python code would speed up thanks to JavaScript runtimes having JITs.