Skip to content

feat: batching execution (single iterator queries)#390

Open
cheb0 wants to merge 5 commits intomainfrom
329-batching-1
Open

feat: batching execution (single iterator queries)#390
cheb0 wants to merge 5 commits intomainfrom
329-batching-1

Conversation

@cheb0
Copy link
Copy Markdown
Collaborator

@cheb0 cheb0 commented Apr 1, 2026

Description

No significant perf improvement, just introduce new types: LIDBatch, BatchedNode. Batch mode enabled for single-iterator queries for sealed fractions.

iterateEvalTree is now works with batches. For one-by-one lid we batch them a bit, for batched flow we just bypass batches as is. To batch one-by-one eval tree lids, a buffer is used. It preallocated with 64k slots.

LIDBatch currently stores lids as []uint32 sorted asc. I had to introduce an unneeded copying from LID batch format to slice of node.LID so that we have a single iterateEvalTree function. It's a cost of avoiding code duplication.

single-iterator query perf

For single-iterator query we transfer batches directly. Hot query perf service:X (hist, total is 1.6 million):

main branch:
29.578 ms

PR:
23.854 ms

stopwatch eval_tree_next fixed

As part of the PR, stopwatch usage for eval_tree_next is adrressed. For low-cardinality query service:X AND level:4 (histogram) it reports the following numbers:

Search (hot) completed. Found 100 documents. Took: 15.812 ms
total >> iterate_eval_tree >> eval_tree_next -> 95.407644ms

With this PR:
Search (hot) completed. Found 100 documents. Took: 13.958 ms
total >> iterate_eval_tree >> eval_tree_next -> 5.5113ms

Part of #329


  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

@cheb0
Copy link
Copy Markdown
Collaborator Author

cheb0 commented Apr 1, 2026

@seqbenchbot up main search-keyword-exact-match-warm

@seqbenchbot
Copy link
Copy Markdown
Collaborator

seqbenchbot commented Apr 1, 2026

Nice, @cheb0 <(-^,^-)=b!

Your request was successfully served.
Identificator for your ongoing benchmark - 73ed4722.

Here is a list of helpful links:

  • Take a look at Grafana dashboard;
  • Live-tailing logs are also available;

Have a great time!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 81.16883% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.54%. Comparing base (124d460) to head (da8604a).

Files with missing lines Patch % Lines
frac/processor/search.go 83.33% 9 Missing and 5 partials ⚠️
frac/sealed/lids/iterator_desc.go 69.56% 5 Missing and 2 partials ⚠️
frac/sealed/lids/iterator_asc.go 78.94% 3 Missing and 1 partial ⚠️
node/batch.go 81.81% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #390      +/-   ##
==========================================
+ Coverage   71.40%   71.54%   +0.14%     
==========================================
  Files         219      220       +1     
  Lines       16454    16568     +114     
==========================================
+ Hits        11749    11854     +105     
- Misses       3834     3840       +6     
- Partials      871      874       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
MutexListAppend-4 5115f7 f70ec9
196.07 MB/s 177.02 MB/s 0.90 🔴

@cheb0
Copy link
Copy Markdown
Collaborator Author

cheb0 commented Apr 1, 2026

@seqbenchbot down 73ed4722

@seqbenchbot
Copy link
Copy Markdown
Collaborator

seqbenchbot commented Apr 1, 2026

Nice, @cheb0 <(-^,^-)=b!

The benchmark with identificator 73ed4722 was finished.
I've prepared a summary for you. Click on Show summary button to see it:

Show summary
Query Type mean (ms) stddev (ms) p(50) (ms) p(95) (ms) p(99) (ms) iterations
base comp diff base comp diff base comp diff base comp diff base comp diff base comp diff
bulk
warm 68.99 68.64 -0.50% 24.66 24.92 +1.08% 63.00 62.00 -1.59% 118.50 117.00 -1.27% 158.50 154.00 -2.84% 2450.00 2450.00 0.00%
service:payment-backend-eu
AND k8s_namespace:prod
warm 123.87 124.02 +0.12% 113.56 116.60 +2.68% 115.00 113.00 -1.74% 223.00 221.00 -0.90% 731.50 759.50 +3.83% 3979.00 3958.00 -0.53%

Have a great time!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
MutexListAppend-4 5115f7 c14eb6
196.07 MB/s 163.95 MB/s 0.84 🔴
83287562.00 ns/op 97590828.00 ns/op 1.17 🔴

@eguguchkin eguguchkin requested review from eguguchkin and forshev April 6, 2026 10:20
@eguguchkin eguguchkin modified the milestones: v0.72.0, v0.73.0 Apr 13, 2026
cheb0 added 2 commits April 18, 2026 18:54
# Conflicts:
#	frac/processor/search.go
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.

4 participants