Skip to content

uses ConcurrentHashMap to increase performance#1

Open
nahian1005002 wants to merge 1 commit intobjrara:masterfrom
nahian1005002:efficient_MappedPageFactory
Open

uses ConcurrentHashMap to increase performance#1
nahian1005002 wants to merge 1 commit intobjrara:masterfrom
nahian1005002:efficient_MappedPageFactory

Conversation

@nahian1005002
Copy link

Previously It used java.util.HashMap to store mapped pages with its indexes. Since HashMap is not thread safe, it used a lock to protect the HashMap to make the implementation thread safe. The lock creates significant lock contention at times in multi-threaded runs.

Here solution is implemented using java.util.concurrent.ConcurrentHashMap which is a thread-safe scalable implementation of hash map. It eliminates the contention and improves performance.

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