Skip to content

Heat map: make render-tree sibling ordering user-selectable (hottest-first vs source order) #24

Description

@hugithordarson

What

The render-tree sorts sibling elements by inclusive time, hottest-first (TreeNode.childrenByHeat(), used at every level of ParsleyRenderHeatmapOverlay). Make the ordering user-selectable, with at least:

  • Hottest-first (current) — worst offender bubbles to the top of each level; best for hunting a slow spot.
  • Source order — siblings read top-to-bottom like the template/DOM; best for mapping the tree back to the template you wrote.

Why

Neither order is universally right. Hottest-first is great when chasing a slow query, but it breaks the mental mapping between the tree and the template — e.g. a <wo:if condition="$similarOther..."> on template line 211 appears above its sibling <wo:if condition="$similarSame..."> on line 200 simply because it rendered a few ms slower (a longer DB round-trip). That's surprising when you're reading the tree as your template. A toggle lets the tool serve both modes.

The node already carries offset() (source position), so source-order sorting is just a different comparator — the data is there.

Note on sequencing (why defer)

Implementing this well means adding an interactive control (+ remembered state, client-side re-sort) to ParsleyRenderHeatmapOverlay, which is currently hand-built StringBuilder HTML — the known wart we intend to rebuild on a proper templating engine. Adding interactive controls to that soup now risks building it twice. Best to land this after the overlay is rebuilt with real templating, where a sort toggle is cheap and clean.

Priority: nice-to-have, deferred until the overlay-HTML rebuild.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions