Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PooledBinary Class #308

Merged
merged 6 commits into from
Nov 21, 2024
Merged

Conversation

MrQuansy
Copy link
Contributor

Summary

Add PooledBinary class for Binary object allocation optimization.

This PR introduces a new PooledBinary class designed for binary object pooling at the application layer. It aims to improve allocation performance and reduce GC overhead by enabling binary object reuse.

Details

The PooledBinary class is similar to the existing Binary class but with additional features to support object pooling:

  • Added length field to indicate the actual valid data length, which is less than or equal to the underlying byte array length
  • Added arenaIndex field to serve the allocator's needs

Next Steps

This is the first step in a series of planned changes. Future PRs will modify specific Binary usages to PooledBinary in the codebase.

@MrQuansy MrQuansy changed the title Add PooledBinary type Add PooledBinary Class Nov 20, 2024
Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

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

PTAL

if (length != binary.getLength()) {
return false;
}
for (int i = 0; i < length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use this API
image

Because it's vectorized.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense

Copy link
Contributor

Choose a reason for hiding this comment

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

not compatible with jdk8 , please ignore this comment

OneSizeFitsQuorum

This comment was marked as outdated.

Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

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

LGTM

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit 01bb672 into apache:develop Nov 21, 2024
11 checks passed
OneSizeFitsQuorum pushed a commit that referenced this pull request Nov 21, 2024
@MrQuansy MrQuansy deleted the blob_allocator branch November 26, 2024 05:06
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.

2 participants