feat: Add jmh benchmarks for adaptive range reads.#277
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 updates the JMH benchmark suite for GCS adaptive range reads. The changes focus on improving the clarity and coverage of performance tests by replacing hardcoded seek scenarios with a more robust random read implementation and expanding the test parameters to include adaptive access patterns. 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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the GcsReadChannelBenchmark by replacing byte array buffers with a class-level ByteBuffer and introducing a randomRead benchmark that iterates through a set of predefined offsets. Additionally, the sequentialRead benchmark's data volume was increased, and new access patterns were added to the benchmark state. Review feedback suggests removing unused imports and modifying the randomRead implementation to handle partial reads, ensuring consistent data processing during benchmarking.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/adaptive-range-read #277 +/- ##
==============================================================
Coverage 98.08% 98.08%
Complexity 282 282
==============================================================
Files 23 23
Lines 836 836
Branches 80 80
==============================================================
Hits 820 820
Misses 8 8
Partials 8 8 🚀 New features to boost your workflow:
|
fd4b59e to
f341835
Compare
|
We need better strategy for maintaining the jmh benchmarks, atleast for class level benchmarks. With addition of different parameters and benchmarks, it becomes time consuming to run all the jmh benchmarks in github runners or CI/CD pipelines. |
|
Raise the PR in main branch since the feature in now merged in main branch |
| largeBuffer = new byte[100 * 1024]; | ||
|
|
||
| localBuffer = ByteBuffer.allocate(64 * 1024); | ||
| offsets = new long[]{ |
There was a problem hiding this comment.
This could be a static constant, rename it to be more meaningful. Eg: <READ_PATTERN>_OFFSETS.
| stream.read(largeBuffer); | ||
| public void randomRead(GcsReadChannelBenchmarkState state) throws IOException { | ||
| for (long offset : offsets) { | ||
| localBuffer.clear(); |
There was a problem hiding this comment.
define localBuffer here itself, what is size of the localBuffer is interesting detail and is hidden here and one needs to search outside the spec.
Type of Change
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools and libraries such as documentation generationDescription
Jmh benchmarks for adaptive range reads.
What?
Modify jmh benchmarks for better visual understanding.
Why?
The existing benchmarks are confusing and does not cover all the use cases for adaptive range read. So modifying to reflect the same
Checklist
feat(core): ...)Generated/Assisted by Agent? [Yes/No]