You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The check is currently one of the slowest checks (it takes up 13.4% of execution time, second slowest check).
Edit: This is no longer the case.
The problematic code sections are:
countStatements (to decide if a code segment is long enough)
Building the occurrences Map (that is related to the implementation of StructuralEqualsVisitor/StructuralHashCodeVisitor).
Here are some ideas to improve performance:
Skip adding more kinds of statements in the occurrences map like CtComment
Only add multiple statements to the occurrences map like CtStatementList, because a single statement would not be enough for a duplicate? What is with things like if (a) b;?
Implement Improve performance of SpoonUtil.resolveConstant #573 which should speed up the isRefactorable method of StructuralEqualsVisitor. It might make sense to build up some cache like with UsesFinder for whether variables are constant/final (I think the whole project would benefit from this).
For StructuralHashCodeVisitor the slowest code is the one that calls StructuralEqualsVisitor#shouldSkip, which should become faster with 3
Cache the structural hashCode of elements in a global IdentityHashMap
Might be faster in DuplicateCode to iterate through the occurrences map than visiting all CtStatement in the model.
The text was updated successfully, but these errors were encountered:
Description
The check is currently one of the slowest checks (it takes up 13.4% of execution time, second slowest check).
Edit: This is no longer the case.
The problematic code sections are:
countStatements
(to decide if a code segment is long enough)occurrences
Map (that is related to the implementation ofStructuralEqualsVisitor
/StructuralHashCodeVisitor
).Here are some ideas to improve performance:
CtComment
CtStatementList
, because a single statement would not be enough for a duplicate? What is with things likeif (a) b;
?SpoonUtil.resolveConstant
#573 which should speed up theisRefactorable
method ofStructuralEqualsVisitor
. It might make sense to build up some cache like withUsesFinder
for whether variables are constant/final (I think the whole project would benefit from this).StructuralHashCodeVisitor
the slowest code is the one that callsStructuralEqualsVisitor#shouldSkip
, which should become faster with 3hashCode
of elements in a globalIdentityHashMap
DuplicateCode
to iterate through the occurrences map than visiting allCtStatement
in the model.The text was updated successfully, but these errors were encountered: