Skip to content

Architecture: render() hides cascading recomputes — Lot Engine runs 3+ times per render call #73

@heyitsStylez

Description

@heyitsStylez

Problem

render() calls compute() once explicitly, but sub-renderers each run additional passes:

  • rStats() calls renderExpiryTable(allRows) which calls compute() again
  • rCharts() calls computePnl(trades, sFilter, livePrices) — another full pass

The Lot Engine runs 3+ times per render() call with no memoization and no signal to the reader. The interface of render() — "just call it" — hides this cost completely.

Files involved

  • src/js/08-render.js
  • src/js/06-render-table.js
  • src/js/07-render-charts.js

Proposed solution

render() does one compute pass at the top and passes results down to every sub-renderer explicitly. Sub-renderers become pure functions of their arguments with no global reads.

Benefits

  • Locality — a perf regression in the Lot Engine is immediately visible in render()
  • Testability — sub-renderers can be unit-tested by passing synthetic lots/displayRows
  • No hidden execution cost; the render path is readable top to bottom

Category

Deepening opportunity — architecture review

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions