Conversation
|
@onigoetz Thanks for showing me the impressive performance improvement! Do you think is there anything we can change to bring better performance for
|
|
Hi, yes indeed it must be possible to bring these things to synckit as well. The reason I am interested in bringing this PR to this package is the package size; sync-threads is 2-3kB, no dependencies. Whereas synckit is 1MB when installed with all its dependencies. |
Indeed, that's because what I mentioned above
It's much more powerful. And well maintained. Do you think what can I do for speeding up for |
|
It's much more powerful. And well maintained.
I'm up for the challenge and would happily make a PR to Though I have to admit that if possible I would also like to make a PR to remove |
|
Awesome, thanks for this @onigoetz ! As you can tell, I like my libraries nice and lean, so I'll take a while to go through the changes just to ensure it's not adding too much complexity – but your explanations of the changes sound totally reasonable, so it gets a +1 from me so far. Thanks again |
@onigoetz Sure, this can be done with a separate PR, or if you think that's the cause of performance impact, feel free to combine them together. And also, the most dependencies of |
|
@onigoetz After https://github.com/un-ts/synckit/releases/tag/v0.8.8, See also https://bundlephobia.com/package/[email protected] The latest benchmark shows the following on my personal MackBook Pro with your fork repository https://github.com/onigoetz/sync-threads: Previous: After: |
|
I made some more changes to this PR:
The incredibly high memory usage of |
|
@onigoetz Awesome work again, and we can add benchmarks on CI like It would show different benchmark results on different platforms and node versions. See also https://github.com/un-ts/synckit/actions/runs/7405983872/job/20149716081#step:6:8 |
Hi @mhart,
I found a bug in the library and got a bit carried away when fixing it, this PR contains the following (each in their own commit, so can be reviewed separately if needed)
Reusing the worker across calls is a significant performance improvement as you can see:
These tests were run today on my own MacBook Air m2.
I did not push the test for
sync-threads (1.0.1)as it's just to illustrate the point.