Skip to content
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

Slowdown with UnusedImportsCheck #6403

Closed
rnveach opened this Issue Feb 2, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@rnveach
Copy link
Member

rnveach commented Feb 2, 2019

Based on the DebugListener I created in https://github.com/rnveach/checkstyle/commits/more_audits to show how long checkstyle spends executing in various parts during a run, UnusedImportsCheck takes the most time to execute of all our Checks. A total of 3.3 seconds during a 33 second run.

Starting audit...
------------------
Run Time: 32.841

...

Checks: (141)
...
UnusedImportsCheck	448037	3.302	0.0	0.271	0.0
...

(columns are total calls, total time in seconds, min time, max time, and average)

When I added custom watches to see where the issue was, it was happening with the INLINE_TAG_PATTERN when calling find().

The regular expression is bad because it starts with .*? and is only doing a find and not a match all. When this section is removed the time for the check run drops almost to 0.3.

rnveach added a commit to rnveach/checkstyle that referenced this issue Feb 2, 2019

@romani romani added the approved label Feb 3, 2019

romani added a commit that referenced this issue Feb 3, 2019

@romani romani added the bug label Feb 3, 2019

@romani romani added this to the 8.18 milestone Feb 3, 2019

@romani

This comment has been minimized.

Copy link
Member

romani commented Feb 3, 2019

fix is merged.

@romani romani closed this Feb 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.