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

Specify SubscriberIndex size when initializing HashMap #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anshu56
Copy link

@anshu56 anshu56 commented Feb 20, 2017

Initializing the HashMap with a specific size is an optimization for when we're adding a large number of subscribers to the index. By default the HashMap will only be created with a capacity of 4, so if we add a large number of subscribers the map will have to expand it's size several times. This can cause garbage collections that slow down App launch.

Initializing the HashMap with a specific size is an optimization for when we're adding a large number of subscribers to the index. By default the HashMap will only be created with a capacity of 4, so if we add a large number of subscribers the map will have to expand it's size several times. This can cause garbage collections that slow down App launch.
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.

1 participant