The SyncService runFullSync operation is currently slow (~4.7s) even when no local or remote changes have occurred. This is due to two primary inefficiencies in the push and pull phases.
Problem Areas
- Inefficient Push Scope: The
#pushToGitHub method currently scans all local issue files for changes, including thousands of files in the ISSUE_ARCHIVE directory. This is unnecessary, as archived issues can be considered immutable. The file I/O and hashing for these archived files is the main contributor to the slowdown.
- Unconditional Release Writes: The
#syncReleaseNotes method unconditionally rewrites all local release note files on every run, regardless of whether the content has changed on GitHub. This causes unnecessary disk I/O.
Proposed Solution
This ticket proposes a two-pronged approach to optimize the sync process:
1. Limit Push Scope to Active Issues
- Modify the
#scanLocalFiles method to only scan the active issues directory (issueSyncConfig.issuesDir).
- The
issueSyncConfig.archiveDir will be completely ignored during the push phase.
- This change is based on the strategic assumption that archived issues are immutable and will not be edited locally. This single change will provide the most significant performance improvement by drastically reducing the number of files to process.
2. Implement Content Hashing for Release Notes
- In the
#syncReleaseNotes method, for each release fetched from GitHub, generate a SHA-256 content hash of the complete Markdown content (frontmatter + body) that would be written to disk.
- Store these hashes in the
.sync-metadata.json file. The existing releases cache can be enhanced to store an object with the release data and the content hash.
- Before writing a release note file, compare the newly generated hash with the hash stored in the metadata from the previous run.
- The file will only be written if the hash is different, or if no previous hash exists for that release tag.
Acceptance Criteria
- The
runFullSync duration is significantly reduced when no changes are present.
- The
#pushToGitHub operation no longer scans or processes files within the ISSUE_ARCHIVE directory.
- The
#syncReleaseNotes operation only writes files to disk when the corresponding release content on GitHub has actually changed.
- The
.sync-metadata.json file is updated to store content hashes for release notes to enable this change detection.
The
SyncServicerunFullSyncoperation is currently slow (~4.7s) even when no local or remote changes have occurred. This is due to two primary inefficiencies in the push and pull phases.Problem Areas
#pushToGitHubmethod currently scans all local issue files for changes, including thousands of files in theISSUE_ARCHIVEdirectory. This is unnecessary, as archived issues can be considered immutable. The file I/O and hashing for these archived files is the main contributor to the slowdown.#syncReleaseNotesmethod unconditionally rewrites all local release note files on every run, regardless of whether the content has changed on GitHub. This causes unnecessary disk I/O.Proposed Solution
This ticket proposes a two-pronged approach to optimize the sync process:
1. Limit Push Scope to Active Issues
#scanLocalFilesmethod to only scan the active issues directory (issueSyncConfig.issuesDir).issueSyncConfig.archiveDirwill be completely ignored during the push phase.2. Implement Content Hashing for Release Notes
#syncReleaseNotesmethod, for each release fetched from GitHub, generate a SHA-256 content hash of the complete Markdown content (frontmatter + body) that would be written to disk..sync-metadata.jsonfile. The existingreleasescache can be enhanced to store an object with the release data and the content hash.Acceptance Criteria
runFullSyncduration is significantly reduced when no changes are present.#pushToGitHuboperation no longer scans or processes files within theISSUE_ARCHIVEdirectory.#syncReleaseNotesoperation only writes files to disk when the corresponding release content on GitHub has actually changed..sync-metadata.jsonfile is updated to store content hashes for release notes to enable this change detection.