Skip to content

Improve performance of waypoint reached logic (see #7)#8

Merged
nmarks99 merged 3 commits into
masterfrom
reached
May 14, 2026
Merged

Improve performance of waypoint reached logic (see #7)#8
nmarks99 merged 3 commits into
masterfrom
reached

Conversation

@nmarks99
Copy link
Copy Markdown
Collaborator

As described in #7, we are unnecessarily polling the "Reached" record (e.g. WaypointJ:1:Reached) for every waypoint at 10Hz when really only 1 waypoint is "active" at a time.

This PR addresses this by adding waypoint_reached.db which contains logic to check if a single waypoint is reached. Which waypoint we check is set by the waypointL and waypointJ databases when moves are executed or the Reset records process (e.g. WaypointJ:1:Reset).

This reduces the number of 10Hz polling loops from N to 1 where N is the total number of waypoints (default 60). Though theoretically this sounds like a big performance improvement, a rudimentary comparison of CPU usage with htop does not show much difference.

nmarks99 added 3 commits May 14, 2026 13:12
This generally works and only need 1 luascript record scanning at 10Hz.
However the Waypoint Reached PVs can be stale due to the logic with
Waypoint Reset
This makes more sense than before. Instead of Reset just
setting Reached, it sets the active waypoint reached checker's
active wp number and type so it is handled there
- Fix seq records in waypointJ/L. Need to use 0 or 1 instead of
"J" and "L" in seq DOL apparently.
- cleanup old code in waypoints.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant