Skip to content

Avoid full task-list scans for async identity lookup and dependent wakeups #533

Description

@LunaStev

The executor performs linked-list scans in _find, _wake_dependents, and each _drive scheduling round. Task records are retained for reuse until shutdown. After a large fan-out has completed, operations can still traverse the historical high-water list; waking many dependents also produces quadratic work in the number of task slots.

This is a source-level complexity finding, not a claimed benchmark result. A focused patch should establish deterministic work counters before choosing data structures.

Source evidence at the head of #520:

Acceptance:

  • Add bounded fan-out/join and grow-then-shrink workloads with operation or traversal counters rather than timing-only gates.
  • Provide efficient identity lookup and explicit dependency/ready bookkeeping while keeping the single-threaded executor model.
  • Ensure completed/reused slots do not make steady-state work proportional to all historical slots.
  • Preserve single-consumer futures, wake coalescing and cancellation correctness.

Related: #444. This is a focused complexity follow-up to its initial executor, not a request for a multithreaded runtime.

Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. This follows up the implementation introduced in draft PR #520.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedThe issue requires extra attention or help from others.performanceIssues related to performance or optimization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions