Skip to content

refactor(timeline): parse each usage timestamp once before sorting - #582

Draft
seonghobae wants to merge 8 commits into
developmentalfrom
bolt/optimize-timeline-sort-10957893818914055786
Draft

refactor(timeline): parse each usage timestamp once before sorting#582
seonghobae wants to merge 8 commits into
developmentalfrom
bolt/optimize-timeline-sort-10957893818914055786

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 5, 2026

Copy link
Copy Markdown

Current exact authority

  • protected base: developmental@2fa92012bcf80acc1f921a4bafea76b3b1424b46
  • exact head: e1dd7cc5c6ce9cc33990b4f0fc5b4e80dfae7e5e
  • lifecycle: Draft / structural parse-count contract added / hosted gates non-terminal
  • effective delta: session-timeline-chart.tsx plus its focused test only

Finding and causal repair

The generated branch correctly recognized repeated Date.parse() inside the sort comparator, but its implementation discarded the pre-parsed key immediately after sorting and parsed every usage timestamp again during the merge pass. It therefore reduced comparator-time parsing but did not realize the intended one-parse-per-usage boundary.

The current descendant keeps { usage, parsedTimestamp } through sorting and reuses that primitive as the merge cursor timestamp. A focused regression spies on Date.parse with three unsorted usage rows and no tool events, requires exactly one parse per usage row, and verifies chronological output. Existing cumulative tool-summary and input-order immutability tests remain.

Evidence discipline

The branch-generated .jules/bolt.md rule and source comment generalized this into an O(N) sorting optimization and claimed hot-loop performance without a committed representative benchmark. That is not correct: sorting remains O(N log N); only timestamp parsing for usage sort keys is bounded to one O(N) pass. The repository-wide Bolt doctrine was restored byte-for-byte to protected authority and the unmeasured source performance claim was removed.

This PR therefore claims only the deterministic operation-count improvement and behavior preservation. Buyer-path latency, allocation/GC reduction, or material render-speed improvement require separate representative benchmark/profile evidence before being asserted.

Exact-head gates

Fresh workflows for e1dd7cc5... are non-terminal: CI 33997964975, Security Scan 33997965035, SAST Semgrep 33997964993, CodeQL PR 33997964996. Predecessor checks are not transferred. Keep Draft until the unchanged head has terminal applicable gates, zero valid unresolved findings, fresh protected-base compatibility, and the then-live independent-review requirement.

@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/optimize-timeline-sort-10957893818914055786

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as draft September 5, 2026 23:10
@seonghobae seonghobae changed the title ⚡ Bolt: [성능 개선] 타임라인 차트 정렬 최적화 (Schwartzian transform) refactor(timeline): parse each usage timestamp once before sorting Sep 5, 2026
@seonghobae seonghobae added priority: medium Normal-priority or P2 work status: draft Draft pull request type: maintenance Maintenance, build, dependency, or operational upkeep maintenance labels Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance priority: medium Normal-priority or P2 work status: draft Draft pull request type: maintenance Maintenance, build, dependency, or operational upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant