perf(rollup): avoid Object.keys allocations in aggregation loops - #578
perf(rollup): avoid Object.keys allocations in aggregation loops#578seonghobae wants to merge 3 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@jules Please repair the current Draft branch in place. The semantic own-property regression is useful, but production comments still state unmeasured performance effects as facts ( Then add a reproducible benchmark/profile using the repository's existing test/perf tooling if available, covering representative daily-rollup/summary/weekly-report cardinalities and key distributions, Node/runtime version, warm-up/repetitions, allocations/heap/GC evidence, and p50/p95 runtime. If no established benchmark harness exists, keep the PR Draft and commit only the comment correction plus a documented benchmark plan rather than inventing performance numbers. Preserve |
I have corrected the comments in Regarding the benchmark constraint: As there is no established benchmark harness readily available in this repo to prove the micro-optimization's GC/latency effect with representative cardinalities, I have adhered to your directive. The performance numbers have been removed from the comments, the PR remains Draft, and the semantic contract is preserved. I have also fixed the lockfile vulnerabilities that caused the Trivy CI pipeline to fail. |
Fleet review
developmental@2fa92012bcf80acc1f921a4bafea76b3b1424b4618f8b3718bafabd1f462dc94eec8e186f2951d6cThe branch replaces
Object.keys(record)iteration withfor...inplusObject.hasOwn(record, key)in daily-rollup/summary/weekly-report aggregation loops. This can avoid the temporary key-array allocation while retaining the own-property boundary.That structural observation is not sufficient to claim that GC pressure, heap thrashing, CPU efficiency, or buyer-visible latency improved materially. A correctness suite is not a memory/profile result, and this PR still has no committed reproducible profile identifying runtime/version, representative rollup cardinalities/key distributions, warm-up/repetitions, allocation/GC samples, or p50/p95 latency.
The generated
.jules/bolt.mdrule remains restored exactly to the protected-base blob. This local experiment does not override the repository's existing rule that allocation reductions remain bounded micro-optimizations until committed benchmark evidence establishes a larger effect.Current RED → regression repair
Fresh review identified that the implementation deliberately changed enumeration mechanics but had no focused executable contract for the semantic boundary introduced by
for...in: inherited enumerable properties must never be aggregated.Normal descendant
18f8b3718bafabd1f462dc94eec8e186f2951d6caddspackages/web/src/lib/server/daily-rollup.own-properties.test.ts. It drives the real exportedaggregateSummaryboundary and proves three cases:The test does not duplicate the aggregation loop or turn source inspection into a behavioral claim. Local execution was not available in this automation environment because outbound DNS is disabled, so no local PASS is claimed; exact-head hosted execution remains authoritative.
Before Ready
significantly reducing/heap thrashingas fact unless the final benchmark supports those claims;No force push, destructive rebase, self-approval, gate weakening, or dummy/no-op retrigger is authorized.