refactor(call-tree): truly unmerge time-order, rename to TimeOrderTree#761
Merged
lcottercertinia merged 1 commit intoMay 14, 2026
Merged
Conversation
- 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
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 PR Overview
toUnmergedCallTreein the time-order view only built single rows at the top level — descendants recursed throughtoMergedCallTree, silently collapsing adjacent same-signature events with no UI indication. Replaces it withtoTimeOrderTree, which produces one row perLogEventat every level, renames the row type to match its actual role, and drops the dead merge subsystem.🛠️ Changes made
TimeOrderTree.tsreplacesMergeAdjacent.ts:toTimeOrderTreerecurses via a singlebuildRowat every depth, so descendants are no longer routed throughtoMergedCallTree.MergedCalltreeRow→TimeOrderRowacrossCalltreeView.ts,TimeOrderTable.ts,TableShared.ts,BottomCalcs.ts.toMergedCallTree,createMergedRow,getSignatureKey,isWithinGapThreshold, gap-threshold constants) plus row fields no consumer ever read (isMerged,mergeCount,mergedEvents,durationRange,callCount,avgSelfTime).new Array(n)pre-allocation for both top-level results and per-parent children, classicalfor (let i = 0; i < n; i++)loops at every level, and an inlined++nextcounter captured directly by the recursive closure (no per-rowidFor()call).🧩 Type of change (check all applicable)
📷 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?
📚 Docs updated?
Anything else we need to know? [optional]
None.