[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel execution #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

smartrejames
Copy link

Hi there, in this merge request, I have rewritten most of the fs.xxxSync functions using their corresponding fs/promise APIs to enhance parallel execution.

@beenotung
Copy link
Owner

I intentionally use sync fs APIs for cli because it tend to run faster due to less async overhead.

As my understanding, the disk IO cannot be paralleled when the files are stored in the same disk.

@beenotung
Copy link
Owner

We could setup benchmark to check if using async APIs actually speed up.

@smartrejames
Copy link
Author

In my scenario, around 10 js files, the execution time has been reduced from 318ms to 88ms.

@beenotung
Copy link
Owner
beenotung commented Apr 4, 2023

Are the files stored on SSD or rational harddisk in your case?

I'll also do some test when I have access to computer.

@beenotung
Copy link
Owner
beenotung commented May 16, 2024

It seems your async version is faster than your sync version in most cases.
I tried to turn the current version into async version, the observation shows reversed difference.

I'll setup a more comprehensive benchmark before making decision.

Thanks for raising up the direction 🌱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants