logoalt Hacker News

derodero24today at 1:05 PM1 replyview on HN

I went through a similar journey trying worker threads for CPU-bound work in Node. The serialization cost of passing data between threads ate most of my gains, especially with larger inputs. Ended up going the napi-rs route instead — Rust addon running in the main thread with near-zero FFI overhead. Different tradeoff since you lose the parallelism, but for my workload the raw speed was already enough.


Replies

devnotes77today at 2:03 PM

[dead]