Skip to content

refactor(call-tree): truly unmerge time-order, rename to TimeOrderTree#761

Merged
lcottercertinia merged 1 commit into
certinia:mainfrom
lukecotter:feat-remove-timeorder-merge
May 14, 2026
Merged

refactor(call-tree): truly unmerge time-order, rename to TimeOrderTree#761
lcottercertinia merged 1 commit into
certinia:mainfrom
lukecotter:feat-remove-timeorder-merge

Conversation

@lukecotter
Copy link
Copy Markdown
Contributor

📝 PR Overview

toUnmergedCallTree in the time-order view only built single rows at the top level — descendants recursed through toMergedCallTree, silently collapsing adjacent same-signature events with no UI indication. Replaces it with toTimeOrderTree, which produces one row per LogEvent at every level, renames the row type to match its actual role, and drops the dead merge subsystem.

🛠️ Changes made

  • New TimeOrderTree.ts replaces MergeAdjacent.ts: toTimeOrderTree recurses via a single buildRow at every depth, so descendants are no longer routed through toMergedCallTree.
  • Renames MergedCalltreeRowTimeOrderRow across CalltreeView.ts, TimeOrderTable.ts, TableShared.ts, BottomCalcs.ts.
  • Deletes the now-dead merge subsystem (toMergedCallTree, createMergedRow, getSignatureKey, isWithinGapThreshold, gap-threshold constants) plus row fields no consumer ever read (isMerged, mergeCount, mergedEvents, durationRange, callCount, avgSelfTime).
  • Tightens the hot path: new Array(n) pre-allocation for both top-level results and per-parent children, classical for (let i = 0; i < n; i++) loops at every level, and an inlined ++next counter captured directly by the recursive closure (no per-row idFor() call).

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

📷 Screenshots / gifs / video [optional]

No screenshot needed — the change shows up as extra rows in the time-order tree where adjacent same-signature events were previously collapsed.

🔗 Related Issues

related #333

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🙅 not needed

Anything else we need to know? [optional]

None.

- Replace `MergeAdjacent.ts` with `TimeOrderTree.ts`: `toTimeOrderTree` recurses via a single `buildRow` at every depth instead of routing descendants through `toMergedCallTree`. Eliminates the silent adjacent-event merge that had no UI surface and was firing at every level below the top.

- Rename `MergedCalltreeRow` → `TimeOrderRow` and drop the dead merge
  subsystem (`toMergedCallTree`, `createMergedRow`, `getSignatureKey`, `isWithinGapThreshold`, gap-threshold constants) plus the row fields no consumer ever read (`isMerged`, `mergeCount`, `mergedEvents`, `durationRange`, `callCount`, `avgSelfTime`).

- Tighten the hot path: `new Array(n)` pre-allocation for children and top-level results, classical `for (let i = 0; i < n; i++)` loops at every level, and an inlined `++next` counter captured directly by the recursive closure (no per-row `idFor()` call).
@lcottercertinia lcottercertinia merged commit bc88ffc into certinia:main May 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants