Excessibility.TelemetryCapture.Analyzers.RenderEfficiency (Excessibility v0.16.0)

Copy Markdown View Source

Analyzes render efficiency by detecting wasted renders.

A "wasted render" is a render that repaints identical state — nothing changed since the view last rendered. Crucially this is measured against the previous render in the same view, not the immediately preceding timeline event: LiveView captures a handle_event and its resulting render as two events, so the render's own diff-vs-previous is empty even though the interaction genuinely changed state. Counting that render as wasted would flag every render_click/render_submit in a healthy test (issue #142). The first render in a view (the initial paint) is never wasted.

Thresholds

  • Warning: 3+ wasted renders
  • Critical: >30% of renders are wasted

Output

%{
  findings: [
    %{
      severity: :critical,
      message: "3 of 5 renders (60%) had no state changes",
      events: [2, 4, 5],
      metadata: %{wasted_count: 3, total_count: 5}
    }
  ],
  stats: %{
    render_count: 5,
    wasted_render_count: 3,
    efficiency_ratio: 0.4
  }
}

Summary

Functions

analyze(map, opts)

Callback implementation for Excessibility.TelemetryCapture.Analyzer.analyze/2.

default_enabled?()

Callback implementation for Excessibility.TelemetryCapture.Analyzer.default_enabled?/0.

name()

Callback implementation for Excessibility.TelemetryCapture.Analyzer.name/0.