Skip to content

Conversation

@zhagnlu
Copy link
Contributor

@zhagnlu zhagnlu commented Jan 15, 2026

issue: #47001

different batch effect for same test:

Batch Size 峰值内存 构建时间 Term Query
1 107-118 MB 10.4-10.7s 0.11ms (~8900 QPS)
64 330 MB 10.6s 0.12ms (~7900 QPS)
148 610 MB 10.7s 0.12ms (~8000 QPS)
304 1131 MB 11.1s 0.13ms (~8000 QPS)
4096 13500 MB 12.3s 0.14ms (~8000 QPS)

@gemini-code-assist
Copy link

Summary of Changes

Hello @zhagnlu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a potential Out-Of-Memory (OOM) issue by streamlining the document addition process within the add_json_key_stats function. It removes an external batching mechanism that was redundant, as the underlying Tantivy IndexWriter already provides efficient internal buffering. This change simplifies the codebase and enhances memory management by preventing unnecessary accumulation of documents in an external batch.

Highlights

  • Removed redundant batching logic: The explicit BATCH_SIZE constant and the manual batching mechanism within the add_json_key_stats function have been removed. This external batching was found to be unnecessary as Tantivy's IndexWriter handles internal buffering efficiently.
  • Addressed potential Out-Of-Memory (OOM) issues: By removing the redundant batching, the pull request aims to resolve potential Out-Of-Memory issues that could arise from the previous implementation, as indicated by the PR title.
  • Simplified document addition process: Documents are now added one by one directly to the index_writer, relying on its inherent buffering capabilities, which simplifies the code and improves clarity.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sre-ci-robot sre-ci-robot added the size/S Denotes a PR that changes 10-29 lines. label Jan 15, 2026
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zhagnlu
To complete the pull request process, please assign yanliang567 after the PR has been reviewed.
You can assign the PR to them by writing /assign @yanliang567 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Jan 15, 2026
@sre-ci-robot
Copy link
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm
  • /ci-rerun-e2e-default // for ci-v2/e2e-default

If you have any questions or requests, please contact @zhikunyao.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes unnecessary manual batching when adding documents, correctly relying on Tantivy's internal buffering. This simplifies the code. However, the new implementation introduces a performance concern by creating a new vector for each document inside a loop. I've provided a suggestion to address this by using a more direct and efficient method for adding documents.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.41%. Comparing base (7bcd3b1) to head (26fea2f).
⚠️ Report is 45 commits behind head on master.

❌ Your project check has failed because the head coverage (76.41%) is below the target coverage (77.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #47078      +/-   ##
==========================================
+ Coverage   76.39%   76.41%   +0.01%     
==========================================
  Files        2004     2004              
  Lines      320988   321447     +459     
==========================================
+ Hits       245224   245630     +406     
- Misses      67858    67909      +51     
- Partials     7906     7908       +2     
Components Coverage Δ
Client 75.75% <ø> (ø)
Core 82.75% <92.67%> (+0.03%) ⬆️
Go 74.88% <61.88%> (+<0.01%) ⬆️
see 34 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhagnlu
Copy link
Contributor Author

zhagnlu commented Jan 15, 2026

/ci-rerun-ut-go

@mergify mergify bot added the ci-passed label Jan 15, 2026
@SpadeA-Tang
Copy link
Contributor

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug lgtm size/S Denotes a PR that changes 10-29 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants