-
Notifications
You must be signed in to change notification settings - Fork 62
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
Performance tests and improvements: LLVM and Type updates #775
Conversation
KuechA
commented
May 11, 2022
- Test the performance of larger LLVM files
- Improve performance when handling phi: Use SubgraphWalker less frequently
- Improve performance of type updates: Use lists instead of sets
Kudos, SonarCloud Quality Gate passed! |
return typeCache; | ||
} | ||
|
||
public synchronized void cacheType(HasType node, Type type) { | ||
if (!isUnknown(type)) { | ||
typeCache.computeIfAbsent(node, n -> new HashSet<>()).add(type); | ||
List<Type> types = typeCache.computeIfAbsent(node, n -> new ArrayList<>()); | ||
if (!types.contains(type)) { |
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.
Isn't this essentially the same as a set does? Not sure this is really faster / better here.
@@ -131,7 +131,7 @@ public void setModifiers(List<String> modifiers) { | |||
} | |||
|
|||
@Override | |||
public void typeChanged(HasType src, Collection<HasType> root, Type oldType) { | |||
public void typeChanged(HasType src, List<HasType> root, Type oldType) { |
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.
Would it be possible to keep Collection in the function signature here?
@@ -83,7 +83,7 @@ public Type getPropagationType() { | |||
} | |||
|
|||
@Override | |||
public void setType(Type type, Collection<HasType> root) { | |||
public void setType(Type type, List<HasType> root) { |
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.
Same here. Keep signature and only change the implememation?
@@ -165,12 +165,11 @@ public void typeChanged(HasType src, Collection<HasType> root, Type oldType) { | |||
} | |||
|
|||
@Override | |||
public void possibleSubTypesChanged( | |||
HasType src, Collection<HasType> root, Set<Type> oldSubTypes) { | |||
public void possibleSubTypesChanged(HasType src, List<HasType> root) { |
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.
Here as well I guess