Hacker News new | ask | show | jobs
by Magical 3170 days ago
What does this give you over using fork in node? The zone concept seems nice but I'm not understanding why I would use napa when node is designed to easily spawn nodes of parallel execution?
1 comments

If I understand correctly, it looks like it allows some basic sharing of data without duplicating it in a bunch of heaps. It's not 100% shared memory, in that if several threads are accessing an object, that object will be duplicated in each thread, but it has a store mechanism which essentially can serve as an in-process cache that is shared across multiple threads.
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.