Skip to content

[Perf]: Optimize InMemoryTaskStore::List for large task sets #84

Closed

Description

@MisterVVP

Benchmark signal

BM_TaskStore_List_ManyTasks is the largest hotspot by far, around 1.13 ms. It is much slower than point lookup benchmarks and also feeds into REST/JSON-RPC ListTasks paths.

Problem

The current list path likely does too much per request: scans ordered IDs, resolves map entries, filters, builds a temporary pointer vector, copies/project tasks, and paginates.

Task

Improve InMemoryTaskStore::List performance for 1k+ tasks.

Scope

  • Avoid unnecessary temporary vectors where possible.
  • Apply pagination earlier when filters allow it.
  • Avoid copying full protobuf Task objects until the item is actually included in the response.
  • Consider maintaining a compact ordered task index or cached sorted view.
  • Benchmark filtered and unfiltered list paths separately.

Success criteria

  • Reduce BM_TaskStore_List_ManyTasks by at least 40%.
  • Target: from ~1.13 ms to ≤700 µs.
  • Ensure BM_RestTransport_ListTasks and BM_JsonRpcTransport_ListTasks improve as follow-on effects.

Activity

  1. added
    performance
    on May 29, 2026
  2. changed the title [-]Optimize InMemoryTaskStore::List for large task sets[/-] [+][Perf]: Optimize InMemoryTaskStore::List for large task sets[/+] on May 29, 2026
  3. moved this from Todo to In Progress in a2a-cpp SDK Roadmapon Jul 27, 2026
  4. self-assigned this
    on Jul 27, 2026
  5. linked a pull request that will close this issueOptimize in-memory task listing #174on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueperformance

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions