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

Prevent Bolt from rewriting files as often #37

Closed
wants to merge 2 commits into from

Conversation

ali00209
Copy link

Debounced File Saving:

The updated version introduces a debounced saving mechanism. This helps reduce the number of file write operations by delaying the save for a short period (500ms) and combining multiple save requests into a single operation. It also checks for actual changes in the content before saving, which can further reduce unnecessary writes.

Content Caching:

  • The new version introduces a content cache (#contentCache) to store the latest content of each file. This allows for quick comparisons between old and new content without reading from the file system every time.

Immediate In-Memory Updates:

  • The updated version updates the in-memory representation of the file immediately after a save operation is triggered, rather than waiting for the file system watcher to detect the change. This provides a more responsive user experience.

Error Handling:

  • Both versions include error handling, but the new version provides more detailed logging, which can be helpful for debugging.

Performance Optimization:

  • The debounced saving and content caching mechanisms in the new version can lead to better performance, especially when dealing with frequent file changes or large files.

@ali00209 ali00209 closed this Oct 22, 2024
@ali00209 ali00209 deleted the new_branch branch October 22, 2024 06:50
@ali00209 ali00209 restored the new_branch branch October 22, 2024 06:50
@ali00209 ali00209 deleted the new_branch branch October 22, 2024 07:03
@coleam00
Copy link
Collaborator

Is there a reason you closed this? Looks awesome @ali00209!

@ali00209
Copy link
Author

i added new a one [https://github.com//pull/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.

2 participants