Skip to content

Comments

fix: add containsKey override for GenericData class#2151

Merged
diegomarquezp merged 3 commits intogoogleapis:mainfrom
logachev:kirl/generic_data_contains_key
Feb 24, 2026
Merged

fix: add containsKey override for GenericData class#2151
diegomarquezp merged 3 commits intogoogleapis:mainfrom
logachev:kirl/generic_data_contains_key

Conversation

@logachev
Copy link
Contributor

When running JFR profiling for Google BigQuery JDBC driver, I saw large amount of samples points to Map.containsKey function.

image

When I tried local changes to BQ Java SDK to avoid containsKey call and call get() instead & validate if result is null or not, calls to get function, they don't generate as many samples.

Due to containsKey override missing, it falls back to the default Map.containsKey implementation which seems to be more expensive in the case of GenericData class. I didn't run sampler with these changes, but attaching results when containsKey was replaced with get() in the SDK.

image

@logachev logachev requested a review from a team as a code owner February 20, 2026 19:23
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Feb 20, 2026
@blakeli0
Copy link

Can we change the title from chore to fix?

@logachev logachev changed the title chore: add containsKey override for GenericData class fix: add containsKey override for GenericData class Feb 23, 2026
@diegomarquezp diegomarquezp merged commit fbada29 into googleapis:main Feb 24, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants