Skip to content

Comments

chore: add containsKey override for GenericData class#2151

Open
logachev wants to merge 3 commits intogoogleapis:mainfrom
logachev:kirl/generic_data_contains_key
Open

chore: add containsKey override for GenericData class#2151
logachev wants to merge 3 commits intogoogleapis:mainfrom
logachev:kirl/generic_data_contains_key

Conversation

@logachev
Copy link

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
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.

3 participants