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

Avoid map resizing in PrivateViewConfig #730

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

kilink
Copy link
Member

@kilink kilink commented Sep 21, 2024

Properly size the LinkedHashMaps in the createState method to avoid rehashing / resizing. Additionally, if instrumentation is not enabled, just use the singleton empty map.

To facilitate this change, add an Iterables utility class with a "size" helper to determine the size of the passed in Iterable; this is necessary because the Config::keys method returns Iterable, but in practice is typically a Collection.

Finally, add a marker annotation, Internal, to indicate classes such as Maps and Iterables that are not meant to be used by users of Archaius and may not have stable APIs.

Properly size the LinkedHashMaps in the createState method to avoid rehashing / resizing.
Additionally, if instrumentation is not enabled, just use the singleton empty map.

To facilitate this change, add an Iterables utility class with a "size" helper to determine
the size of the passed in Iterable; this is necessary because the Config::keys method returns
Iterable, but in practice is typically a Collection.

Finally, add a marker annotation, Internal, to indicate classes such as Maps and Iterables that
are not meant to be used by users of Archaius and may not have stable APIs.
@kilink kilink force-pushed the private-view-config-map-resizing branch from 2e1aa8f to 6dadc2e Compare September 21, 2024 18:52
@rgallardo-netflix rgallardo-netflix merged commit e9bbde9 into 2.x Sep 23, 2024
10 checks passed
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