Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Sep 12, 2025

Which issue does this PR close?

Rationale for this change

I found this while working on #7997

Basically, the fact that the CacheOptionsBuilder had both owned and non owned fields made it a bit akward to work with -- if it is going to be zero copy (references) we pay the price of tracking lifetimes already. We may as well just do so for the Arc as well

I don't expect this to make any measurable different in performance. I am mostly treating it as a cleanup

What changes are included in this PR?

Remove one Arc::clone

Are these changes tested?

By existing CI
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?

Are there any user-facing changes?

If there are user-facing changes then we may require documentation to be updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.

@github-actions github-actions bot added the parquet Changes to the parquet crate label Sep 12, 2025
@alamb alamb changed the title Minor: avoid a clone in CacheOptions Minor: avoid an Arc::clone in CacheOptions for Parquet PredicateCache Sep 12, 2025

let cache_options_builder =
CacheOptionsBuilder::new(&cache_projection, row_group_cache.clone());
let cache_options_builder = CacheOptionsBuilder::new(&cache_projection, &row_group_cache);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The "major" change in this PR is to remove this clone

Copy link
Contributor

@etseidl etseidl left a comment

Choose a reason for hiding this comment

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

Looks like a sensible cleanup. Might also save a few microseconds 🤣

@alamb alamb marked this pull request as ready for review September 12, 2025 17:34
@mbrobbel mbrobbel merged commit d082476 into apache:main Sep 13, 2025
17 checks passed
@alamb alamb deleted the alamb/less_clone branch September 13, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants