-
Notifications
You must be signed in to change notification settings - Fork 397
Parallelize the Analyzer #4897
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
Merged
Merged
Parallelize the Analyzer #4897
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0f3ba71
Make class loading thread safe
gzm0 530a704
Make error collection thread-safe
gzm0 c857067
Make module dependency collection thread-safe
gzm0 6e9a0c9
Make topLevelExportInfo collection thread-safe
gzm0 9450a37
Make MethodInfo management thread-safe
gzm0 eb8f45b
Make from collection thread-safe
gzm0 d7d915a
Make jsNativeMember collection thread-safe
gzm0 4d8ffce
Make field collection thread-safe
gzm0 f7d6db5
Make reachability flags thread-safe
gzm0 355ca93
Make method dispatch thread-safe
gzm0 0da7a54
Parallel analyzer
gzm0 a28fa78
Rewrite computeMostSpecificProxyMatch
gzm0 9a0143c
Honor the `parallel` flag in the Analyzer
gzm0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Honor the
parallel
flag in the Analyzer
- Loading branch information
commit 9a0143c655421deac343ef789fda322bbe9a32de
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, the TrieMap will not compact the removed entry, so the mememory usage will be lager than the ConcurrentHashMap, but the ConcurrentHashMap have a different trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't remove anything from these maps, so that doesn't seem like a relevant concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: TrieMap supports lock-free, "opportunistic" getOrElseUpdate (might create the value multiple times, but won't if it's already in the map).
ConcurrentHashMap
doesn't (computeIfAbsent
). That was the primary motivator to useTrieMap
.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always use a
get
to check before invoking thecomputeIfAbsnet
, and the bug you mentioned about ConcurrentHashMap has been fixed in JDK 9.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean with "the bug I mention". The JavaDoc is very clear that
computeIfAbsent
can be blocking:While this can be desirable sometimes, it's not what we want here: We do not need the guarantee that the method invocation is performed atomically, but we do want the operation to remain lock-free.