2 ms·
Uhhh, read the description. node-sqlite3 uses an asynchronous API for CPU-bound functions. An asynchronous API is only for IO-bound functions. CPU-bound funct
by gwbas1c 9y ago
Uhhh, read the description.
node-sqlite3 uses an asynchronous API for CPU-bound functions.
An asynchronous API is only for IO-bound functions. CPU-bound functions should be synchronous.
- deleted 9y ago[deleted]
- Klathmon 9y agoWell even CPU-bound async functions can have benefits in node.js as they can free up the single javascript thread to do other work while it does the CPU bound work on another thread in the native code. It's definitely a bastardization of the terms a bit, but at its core it's basically a message-passing multi-process system that hides the implementation behind the well-understood (to most programmers that use node) async i/o
- always_good 9y agoWell, CPU-bound work should be done off the event loop thread when means out of process in Node which introduces an I/O boundary and thus an async call.