Skip to content

perf: decide between removing the worker thread and splitting the postMessage envelope #31

Description

@msallin

The per-tick `worker.postMessage(srcPaths)` structured-clones the entire path snapshot, including `activeRoute.waypoints`. Two competing ways to eliminate that cost:

  • Option A — remove the worker. Call `calcs()` inline on the main thread. Eliminates IPC overhead and the worker's V8 heap. Simpler if inline calc latency on a worst-case tick stays well under one delta interval.
  • Option B — split the envelope. Keep the worker but split `srcPaths` into a stable envelope (`waypoints` + `waypointsVersion`, sent only on bump) and a tick envelope (vessel position, COG, SOG, etc., sent every tick). Worker holds the last stable envelope by reference.

A/B both options against the dispatch benchmark from #24 on Pi 3-5 hardware and pick one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions