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

perf: prevent bolt from rewriting files as often #95

Closed
wants to merge 1 commit into from

Conversation

ali00209
Copy link

These changes implement the following improvements:

  1. File content caching: We store the content and last modified time of each file in the #fileCache Map.
  2. Content change check: Before writing a file, we check if the content has actually changed to avoid unnecessary writes.
  3. Debounced writes: Instead of writing files immediately, we add them to a #pendingWrites Map and use a debounce timer to batch write operations.
  4. Batch writing: After the debounce timer expires, we write all pending files in a single batch operation.

These modifications should significantly reduce the frequency of file rewrites, improving performance and reducing unnecessary I/O operations.

@ali00209 ali00209 closed this Oct 27, 2024
@ali00209 ali00209 deleted the new_bolt1 branch October 27, 2024 15:55
@ali00209 ali00209 restored the new_bolt1 branch October 27, 2024 15:59
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.

1 participant