deepset-ai / deepset-ai/haystack
Benchmark Haystack Pipeline
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26.6k
- Forks
- 3.2k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 194
Description
Currently there is no way to benchmark pipelines and its components. It's all either manual (intuition) or making use of logging and deriving results from traces/spans. Though this is fine but this still adds latency and misses the actual few ms due to network or function call. A native way to benchmark the pipelines is a good way to compare results and statistically derive valuable metrics out from your pipeline.
Describe the solution you'd like
- Benchmark as part of
Pipeline()itself - No external dependencies (using default Python methods)
- Results should be both Pipeline level and per component level
- Using percentiles instead of average as it provides more accurate and user-centric view of how the pipeline actually performs in the real world. So
p50, p90, p99are must including avg and total displayed. - Display the benchmark result in a user-friendly way.
Describe alternatives you've considered
- Tracing the pipeline
- Retrieving timestamp from tracer span.
- Then computing per component and pipeline level metrics and then deduce the results.
This isn't a good DX and metrics won't match the actual world pipeline runs as well.
Additional context
Raising PR for review since I feel this is a good value addition to the haystack pipelines.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Pipeline() implementation and inspect how pipeline and component execution are represented, along with the existing tracing approach mentioned in the issue. Define how native timing should cover both levels and how p50, p90, p99, average, and total will be presented. Done means a dependency-free benchmark produces user-friendly pipeline and per-component results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100