-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 issue with file.lastModified() #6096
Labels
Milestone
Comments
Bananeweizen
added a commit
to Bananeweizen/checkstyle
that referenced
this issue
Aug 30, 2018
First check whether this file shall be checked by file name extension, only afterwards check the file timestamp. This can avoid the timestamp access in some cases.
Bananeweizen
added a commit
to Bananeweizen/checkstyle
that referenced
this issue
Aug 30, 2018
@romani I am fine with this. Please review. |
issue is approved, it is reasonable to be lazy in calculations. |
rnveach
pushed a commit
to Bananeweizen/checkstyle
that referenced
this issue
Nov 3, 2018
romani
added a commit
that referenced
this issue
Nov 25, 2018
romani
added a commit
that referenced
this issue
Nov 27, 2018
fix is merged. |
tsunghanjacktsai
pushed a commit
to tsunghanjacktsai/checkstyle
that referenced
this issue
Dec 3, 2018
…e.lastModified()
tsunghanjacktsai
pushed a commit
to tsunghanjacktsai/checkstyle
that referenced
this issue
Dec 3, 2018
…e.lastModified()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checkstyle checks the file time stamp to avoid checking an unmodified file again. At least on Windows, this can be quite costly. On a project with about 300.000 LOC Yourkit tells me that I spend almost a minute in File.lastModified().
This can be improved by not querying the timestamp as the first cancellation condition in the Checker at https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java#L277, but only as late as possible. First we should check cancellation by name.
The text was updated successfully, but these errors were encountered: