Bug 562698 - ProblemCollector.reportProblem call contains every time
Summary: ProblemCollector.reportProblem call contains every time
Status: NEW
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dltk.common-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2020-05-01 11:57 EDT by Dawid Pakula CLA
Modified: 2020-05-01 11:57 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Pakula CLA 2020-05-01 11:57:35 EDT
I realized that in case when file have a lot of problems (mostly unused variable), 90% time took ProblemCollector.reportProblem due internal calls ArrayList.contains:

@Override
public void reportProblem(IProblem problem) {
    if (!problems.contains(problem)) {
        // FIXME (alex) duplicates happen because of AST caching
        problems.add(problem);
    }
}