node-shared-cache | An interprocess shared LRU cache module for Node.JS | Caching library
kandi X-RAY | node-shared-cache Summary
kandi X-RAY | node-shared-cache Summary
An interprocess shared LRU cache module for Node.JS
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-shared-cache
node-shared-cache Key Features
node-shared-cache Examples and Code Snippets
Community Discussions
Trending Discussions on node-shared-cache
QUESTION
I'm currently trying to find the best way to communicate between a master and child processes, in a multi-threaded node.js application. For this I set up some tests, sending a fairly large js object to the child processes and wait for it to respond to the master with the same object.
What i try to achieve with this is to find the fastest possible solution, to sending/receiving and communicating with child_processes or a way to create threads in Node.js (that share the same memory space and possibly scope, but execute on seperate threads) but as far as i'm aware the latter is impossible.
Test sends 1000 messages, child spawning takes on average about 100ms.
Benchmarks:
- IPC 399ms
- node-shared-cache 350ms
- Socket.io 1523ms
- fs streams 325ms
ANSWER
Answered 2018-Jan-09 at 12:13Apparently creating 2 additional pipes (child -> parent and parent -> child) to the stdio is the fastest way to communicate, probably because it's an uninterupted connection. I hope the difference becomes even more noticing with bigger datachunks.
Thanks to everyone who replied! Really appreciate it, it pushed me into doing tests with sockets and eventually uninterrupted streams.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-shared-cache
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page