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

Perform scm updates only on certain events #7

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

jgmdev
Copy link
Member

@jgmdev jgmdev commented Sep 4, 2024

Updates were previously executed by way of a coroutine every second. Even with a cache system in place this caused a performance degradation since git had to scan whole directories for changes.

Now we rely on various events instead by hooking into core functions:

  • DirWatch:check when returning true
  • DirWatch:watch
  • DirWatch:unwatch
  • core.add_project
  • core.remove_project
  • core.set_project
  • core.open_project

Now, only the branch is been updated on a coroutine every 3 seconds, that operation should be fast. Maybe on the future we can instead dirwatch specific scm files/folders like .git or .fslckout.

@jgmdev jgmdev force-pushed the PR/update-on-events branch 2 times, most recently from 2d3d750 to 4688af5 Compare September 4, 2024 23:07
Updates were previously executed by way of a coroutine every
second. Even with a cache system in place this caused a performance
degradation since git had to scan whole directories for changes.

Now we rely on various events instead by hooking into core functions:

* DirWatch:check when returning true
* DirWatch:watch
* DirWatch:unwatch
* core.add_project
* core.remove_project
* core.set_project
* core.open_project

Now, only the branch is been updated on a coroutine every 3 seconds,
that operation should be fast. Maybe on the future we can instead
dirwatch specific scm files/folders like .git or .fslckout.
@jgmdev jgmdev merged commit 26a728e into pragtical:master Sep 4, 2024
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