-
-
Couldn't load subscription status.
- Fork 0
Open
Labels
priority: lowLower priority performance optimizationLower priority performance optimization
Description
Summary
Introduce string interning for frequently reused path values inside the move-file generator caches.
Proposed Solution
const stringInternCache = new Map<string, string>();
function intern(str: string): string {
let interned = stringInternCache.get(str);
if (interned === undefined) {
interned = str;
stringInternCache.set(str, interned);
}
return interned;
}
function getProjectSourceFiles(tree: Tree, projectRoot: string): string[] {
const internedRoot = intern(projectRoot);
const cached = projectSourceFilesCache.get(internedRoot);
// ...
}- Reuse interned strings when storing paths in caches.
- Clear the interning cache each run to keep memory bounded.
Tasks
- Add a simple string interning helper shared across caches
- Apply interning when storing/retrieving paths in hot caches (e.g. project source files)
- Ensure caches are cleared each run to avoid uncontrolled growth
Definition of Done
- Existing benchmark and stress test suites are run before and after the change; report the data in the PR description. This is mandatory.
- Unit/e2e tests continue to pass.
- Document the interning rationale where appropriate.
Metadata
Metadata
Assignees
Labels
priority: lowLower priority performance optimizationLower priority performance optimization