Skip to content

refactor(server): small perfromance improvement when database task store is used - #671

Open
RonaldMarske wants to merge 4 commits into
a2aproject:mainfrom
RonaldMarske:tiny-performance-imporvement
Open

refactor(server): small perfromance improvement when database task store is used#671
RonaldMarske wants to merge 4 commits into
a2aproject:mainfrom
RonaldMarske:tiny-performance-imporvement

Conversation

@RonaldMarske

Copy link
Copy Markdown
Contributor

Avoid loading the Task twice from the TaskStore

What changed

In DefaultRequestHandler, _mapEventToStreamResponse now reads the full Task
from the ResultManager (getCurrentTask()) instead of re-loading it from the
TaskStore for task events. It is now synchronous, and the output is
unchanged (the || event.data fallback stays).

Why

We run a database-backed store, so re-reading the Task is a round-trip per
streamed task event that adds up under load. It is pure overhead:
processEvent, run immediately before, has already built that Task. (Free on
the in-memory store.)

@RonaldMarske
RonaldMarske requested a review from a team as a code owner August 25, 2026 07:09
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

Base PR Delta
src/server/request_handler/default_request_handler.ts 91.72% 91.93% 🟢 +0.21%
Total 91.54% 91.56% 🟢 +0.02%

Generated by coverage-comment.yml

Comment thread src/server/request_handler/default_request_handler.ts Outdated
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.

2 participants