Context
Since the prefabs-filter worker streams filter results as header/chunk messages, MapCanvasHandler (src/index/map-canvas-handler.ts) accumulates the filtered prefabs and re-posts the whole accumulated array to the map-renderer worker on every chunk arrival. For a large result set (e.g. block filter "s", ~1,500 prefabs = ~31 chunks) this issues up to ~31 postMessage({ filteredPrefabs }) calls per filter run.
Current impact
None measured. The forwarded entries are stripped down to { name, x, z, rotation }, so each post clones only small objects, and the map-renderer's throttled redraw coalesces the burst into a few draws. Profiling during the streaming-protocol work showed no long tasks attributable to this path.
Possible improvement
If map redraw cost ever becomes noticeable during typing:
- forward only once per generation, when the accumulated count reaches the header's
total, or
- extend the map-renderer input protocol with append/reset semantics so only new chunks are transferred.
Low priority; filed so the forwarding granularity decision is documented.
Context
Since the prefabs-filter worker streams filter results as header/chunk messages,
MapCanvasHandler(src/index/map-canvas-handler.ts) accumulates the filtered prefabs and re-posts the whole accumulated array to the map-renderer worker on every chunk arrival. For a large result set (e.g. block filter "s", ~1,500 prefabs = ~31 chunks) this issues up to ~31postMessage({ filteredPrefabs })calls per filter run.Current impact
None measured. The forwarded entries are stripped down to
{ name, x, z, rotation }, so each post clones only small objects, and the map-renderer's throttled redraw coalesces the burst into a few draws. Profiling during the streaming-protocol work showed no long tasks attributable to this path.Possible improvement
If map redraw cost ever becomes noticeable during typing:
total, orLow priority; filed so the forwarding granularity decision is documented.