-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority: futureFuture consideration performance optimizationFuture consideration performance optimization
Description
Summary
Stage file writes/deletes during the move-file generator and apply them in batches to reduce virtual tree overhead.
Proposed Solution
interface FileOperation {
type: 'write' | 'delete';
path: string;
content?: string;
}
const pendingFileOperations: FileOperation[] = [];
function scheduleFileWrite(path: string, content: string): void {
pendingFileOperations.push({ type: 'write', path, content });
}
function scheduleFileDelete(path: string): void {
pendingFileOperations.push({ type: 'delete', path });
}
function applyFileOperations(tree: Tree): void {
const writes = pendingFileOperations.filter(op => op.type === 'write');
const deletes = pendingFileOperations.filter(op => op.type === 'delete');
for (const op of writes) {
tree.write(op.path, op.content!);
}
for (const op of deletes) {
tree.delete(op.path);
}
pendingFileOperations.length = 0;
}- Queue file operations and apply writes before deletes.
- Integrate with format/flush lifecycle.
Tasks
- Introduce a queue for pending file operations with types (
write/delete) - Apply queued operations in an optimised order (writes first, then deletes)
- Ensure ordering preserves existing behaviour and integration with formatting steps
Definition of Done
- Existing benchmark and stress test suites are run before and after the change; include the performance deltas in the PR description. This is mandatory.
- Unit/e2e tests keep passing.
- Add documentation/comments explaining the batching approach if necessary.
Metadata
Metadata
Assignees
Labels
priority: futureFuture consideration performance optimizationFuture consideration performance optimization