Skip to content

perf: cut CLI startup and batch overhead#19

Merged
Microck merged 3 commits intomainfrom
perf/autoresearch-loop
Mar 22, 2026
Merged

perf: cut CLI startup and batch overhead#19
Microck merged 3 commits intomainfrom
perf/autoresearch-loop

Conversation

@Microck
Copy link
Owner

@Microck Microck commented Mar 22, 2026

Summary

  • cache shared reqwest::Client instances by timeout instead of rebuilding them on hot paths
  • keep batch search responses structured until the final output boundary instead of serializing and parsing them twice
  • switch the CLI entry runtime to Tokio current_thread to reduce short-invocation overhead

Measured Impact

  • composite benchmark baseline: 1152.092 ms
  • retained-branch best run: 528.389 ms (-54.1%)
  • retained-branch final verification run: 581.169 ms (-49.6%)
  • note: the harness includes real networked Kagi calls, so news/search/quick/batch retain some upstream variance; startup-only commands improved more consistently

Verification

  • cargo build --release && ./.tmp/benchmark-metrics.py
  • cargo test --quiet

Notes

  • autoresearch logs and benchmark artifacts were kept uncommitted
  • discarded experiments included parser selector caching, lazy Tokio init for async-only commands, and release-profile LTO/strip tuning after it exhausted local disk during linking

@Microck Microck merged commit e11e4bb into main Mar 22, 2026
2 of 6 checks passed
@Microck Microck deleted the perf/autoresearch-loop branch March 22, 2026 10:39
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.

1 participant