Feature/improve performance by using estimated slice size#15
Open
vikbert wants to merge 3 commits into
Open
Conversation
- Modified fetch() method to accept estimatedSize parameter - Pre-allocate results slice with capacity of pagOpts.Limit+1 - Eliminates dynamic slice growth during pagination queries - Expected performance improvement: 20-50% for large result sets Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
pedramktb
approved these changes
Mar 15, 2026
Author
|
done |
Author
|
Will you add me to the group who can write in the repo, so that I can see the button "Merge pull request" to merge the PR? |
Author
|
ship it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@pedramktb
In this PR contains a tiny changes to eliminate dynamic memory allocations during pagination queries. The optimization reduces unnecessary slice growth operations by pre-allocating the exact capacity needed upfront. In case of large data set, it brings 30-60% performance improvement.
What do you think about it?