Two wins in the /map hot path. 1. preload_forecast fired on every Leaflet moveend — which arrives in bursts during pan/zoom — and each firing read + filtered + shipped 18 forecast-hour score lists (up to 90k cells per hour at full CONUS view) over the LiveView websocket. Now debounced to the trailing edge: the user must stop moving for 750 ms before we pay the preload cost. select_band and propagation_updated go through the same scheduler so a storm of PubSub updates during an hourly chain also coalesces. 2. ScoreCache.grid_to_filtered_list walked the 92k-cell grid twice (Enum.filter then Enum.map) and allocated an intermediate tuple list between them. Enum.reduce emits only in-bounds result maps directly — halves map traversal + drops the tuple intermediate. |
||
|---|---|---|
| .. | ||
| components | ||
| controllers | ||
| live | ||
| plugs | ||
| endpoint.ex | ||
| gettext.ex | ||
| live_table_footer.ex | ||
| metrics_plug.ex | ||
| router.ex | ||
| skew_t.ex | ||
| telemetry.ex | ||
| user_auth.ex | ||