Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
daiyip
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
1.
▲
by
daiyip
9y ago
Yes in common sense. But for node cluster's case, if we need to load a data set for a worker to serve request, it has to be loaded on each process. While the multi-threaded model will have only one copy.
2.
▲
by
daiyip
9y ago
JXCore is based on node codebase, while Napa.js is written from scratch with multi-threading consideration at its core. We evaluated JXCore before starting Napa.js, but found easier to re-architecture to get performance and memory sharing r
3.
▲
by
daiyip
9y ago
Since everything is in a single process, they can be shared via native structures. Each JS thread has its own heap, there will be a cost to transfer the shared native structures into JS object. For complex objects, usually JSON is used thus
4.
▲
by
daiyip
9y ago
That's correct. Think about a scenario that each worker needs to access a 1GB hash map. In node cluster, we have to load this 1GB map per process, but in the same process, all JS threads can access the map via an addon.
5.
▲
by
daiyip
9y ago
A key design goal is to make all workers within a zone symmetric, broadcasting/executing to specific workers is an anti-pattern. Please see: https://github.com/Microsoft/napajs/wiki/introduction#zone
6.
▲
by
daiyip
9y ago
Here is why napajs is started: https://github.com/Microsoft/napajs/wiki/Why-Napa.js