Repository navigation
cache-transcript-turn-indexes - #29516
harshitgupta31415 wants to merge 1 commit into
Conversation
Summary of ChangesHello, 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 optimizes the transcript formatting logic by caching turn indexes in a Map. This change reduces the computational complexity of formatting nodes for LLMs, resulting in a substantial performance improvement for large datasets while maintaining existing behavior for turn labels and transcript text. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
|
📊 PR Size: size/S
|
There was a problem hiding this comment.
Code Review
This pull request optimizes the formatNodesForLlm utility by caching turn indices in a Map to avoid repeated indexOf lookups, improving performance. Additionally, new unit tests have been added to verify turn numbering behavior with repeated or empty turn IDs, as well as handling of empty histories. There are no review comments, and I have no feedback to provide.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Cache turn indexes in a
Mapinstead of callingindexOf()for every node. Relative turn labels and transcript text stay unchanged.A local synthetic benchmark with 10,000 text nodes and unique turns went from 414.20 ms to 17.91 ms. This measures formatting only.
25 related tests, ESLint, formatting and core typecheck passed. Full preflight is still pending.
Fixes #29514.