PERF: index scheduler tasks instead of linearly scanning them for every context snapshot #168
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/a0-symbolics#168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
The state-snapshot roster loop calls
scheduler.get_task_by_uuid(ctx.id)once for every live context.TaskSchedulerdelegates to a task collection whose implementation is:For task contexts, snapshot construction then calls
scheduler.serialize_task(ctx.id), which resolves the task again before serializing it.The global state path is therefore O(number_of_contexts × number_of_tasks) for classification alone, on top of the other full-roster costs tracked in #19/#20.
get_task_by_namehas the same linear lookup pattern for other callers.Direction
Maintain task indexes under the scheduler's existing lock:
Update indexes transactionally on load/create/update/rename/remove/reload rather than rebuilding in read paths. Snapshot code should iterate/lookup materialized task metadata once.
Acceptance
self.tasks.Mirrored from
lost-rob0t/a0-symbolics#30via tracker sync.