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

refactor: reduce map lookups to reduce number of locks required #373

Merged

Conversation

karenc-bq
Copy link
Contributor

Summary

Instead of calling containsKey then calling get, which requires looking up the map twice, simply call get and check the value. This works because the map doesn't store null values.

Description

Additional Reviewers

@brunos-bq
@aaronchung-bitquill

@karenc-bq karenc-bq self-assigned this Mar 15, 2023
@karenc-bq karenc-bq force-pushed the isJDBCInterface_performance_optimization branch 2 times, most recently from fefe872 to e324efb Compare March 16, 2023 01:43
"executeWithFlags",
"getParameterMetaData"
));
private final static Set<String> METHODS_REQUIRE_UPDATED_TOPOLOGY = new ConcurrentHashMap<String, String>() {{

Choose a reason for hiding this comment

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

will you use any Map functions on this Map? Or just searches on the keySet?

Copy link
Contributor

Choose a reason for hiding this comment

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

ConcurrentHashMap.newKeySet()

@karenc-bq karenc-bq force-pushed the isJDBCInterface_performance_optimization branch from cc73378 to 11d724f Compare March 18, 2023 01:41
@karenc-bq karenc-bq merged commit 400a053 into awslabs:main Mar 18, 2023
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.

3 participants