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.
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
Success criteria