I'm developing a similar util module inspired by this package and esbuild.
It is mainly using the structure from esbuild now with MessageChannel, and I run a benchmark https://github.com/rx-ts/synckit/blob/main/benchmarks/benchmark.txt, it seems much slower during runtime. I was thinking sync-threads would be much faster because it's using v8 serialization inside.
Maybe there are a few reasons:
synckit creates the worker in top createSyncFn and reuse it every time, that's why the load time is much slower that sync-threads
synckit use cache to speed up same file (not benchmarked)
- Maybe the serialization has been improved without v8 (not confirmed, I'm not familiar with v8)
I'm developing a similar util module inspired by this package and
esbuild.It is mainly using the structure from
esbuildnow withMessageChannel, and I run a benchmark https://github.com/rx-ts/synckit/blob/main/benchmarks/benchmark.txt, it seems much slower during runtime. I was thinkingsync-threadswould be much faster because it's usingv8serialization inside.Maybe there are a few reasons:
synckitcreates the worker in topcreateSyncFnand reuse it every time, that's why the load time is much slower thatsync-threadssynckituse cache to speed up same file (not benchmarked)