Skip to content

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Jul 1, 2025

Closes #321

Applied changes based on Issue #321.

I’ve parallelized the file-hashing loop in captureFileState so that files are hashed in parallel—capped to the number of CPU cores—rather than one by one.

Summary of changes:

  • Imported Node’s os module to determine os.cpus().length for a sensible concurrency cap.
  • Replaced the single for…of loop with a pool of “worker” tasks that each pull the next file to hash from a shared index.
  • Each worker does fs.stat() and calculateFileHash() inside a try/catch, preserving the existing warning behavior.
  • Aggregated the workers via Promise.all, then return the full fileState map as before.

This should significantly speed up captureFileState on larger workspaces without changing its external behavior or test results. Let me know if you’d like further tweaks!

@github-actions github-actions bot mentioned this pull request Jul 1, 2025
@YiweiShen YiweiShen merged commit e4e2038 into main Jul 1, 2025
@YiweiShen YiweiShen deleted the codez-chore-321-feat-file-parallelize-file-hashing-3025520064 branch July 1, 2025 21:31
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.

Parallelize file hashing

1 participant