Repository navigation
perf: precompute directory update timestamps - #4479
fabricinhopremium-code wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🚦 Submission status: ⏳ Awaiting automationRisk tier: Why this tier
Automated checks
Action needed
Review
Commands
Updated for |
|
/rerun-checks |
|
🔁 No failed or incomplete checks to re-run.
The status comment updates when the checks finish. |
|
Thanks for the contribution, but after benchmarking this against the repo's actual scale (2,357 tracked files, 73 directories queried across plugins/extensions), the precomputed index approach is not actually faster — it's slightly slower (~5.5ms/run vs ~3.5ms/run for the original). Why: the original code's startsWith check is a cheap early-exit per file, with Date.parse only running on matches. The new approach must scan every file on every build call (even directories never queried), splitting paths and doing multiple Map set/get operations with object allocation per path segment — more total work than it saves at this file/directory ratio. It's also rebuilt from scratch in two separate call sites (generatePluginsData and generateCanvasManifest), so the index itself is never reused across the one place it could help. While the new code is algorithmically O(files × depth + dirs) vs the original's O(dirs × files), the constant-factor overhead outweighs the savings here since neither files nor dirs is large enough for the asymptotic improvement to matter. This reads as a premature optimization without profiling data showing a real bottleneck, so I'm closing it. Happy to revisit if there's a measured regression this addresses. |
$## Summary
This change avoids repeatedly scanning the full git-date map for each plugin and canvas item when populating
lastUpdatedmetadata.Validation
& C:\\Users\\fabricio.fmc\\AppData\\Local\\Programs\\Qlik\\Sense\\Node\\node.exe --check eng\\generate-website-data.mjs