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
Problem
render()callscompute()once explicitly, but sub-renderers each run additional passes:rStats()callsrenderExpiryTable(allRows)which callscompute()againrCharts()callscomputePnl(trades, sFilter, livePrices)— another full passThe Lot Engine runs 3+ times per
render()call with no memoization and no signal to the reader. The interface ofrender()— "just call it" — hides this cost completely.Files involved
src/js/08-render.jssrc/js/06-render-table.jssrc/js/07-render-charts.jsProposed 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
render()lots/displayRowsCategory
Deepening opportunity — architecture review