Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Issue 6883050: presubmit checks: skip computing the diff if possible (Closed)

Created:
9 years, 8 months ago by ncarter (slow)
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Dirk Pranke, M-A Ruel
Visibility:
Public.

Description

Optimize presubmit checks for win32 where determining the diff seems to take an inordinate amount of time. The idea is to lint whole files, and only try to compute deltas if the file contains at least one error. For my environment, the three affected presubmit rules took 2000ms each for a 4-file changelist. With this change, all my rules run in about a second, and none take anything close to 500ms. Also, since there seem to be environment-dependent factors at work here, I'm proposing putting timer warnings that print a message if any check takes longer than 500ms. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82559 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=82568 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82607 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=82653 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82762

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : Optimize presubmit checks for win32 where determining the diff #

Patch Set 10 : Optimize presubmit checks for win32 where determining the diff #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : Fixed O(n^2) issue. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -61 lines) Patch
M presubmit_canned_checks.py View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +88 lines, -36 lines 0 comments Download
M tests/presubmit_unittest.py View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +44 lines, -25 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
ncarter (slow)
This speeds up my presubmits on a 4-line CL from ~7s to ~1s, as reported ...
9 years, 8 months ago (2011-04-19 19:28:12 UTC) #1
M-A Ruel
I disagree, the right fix is to modify presubmit_support.py so: - AffectedFile.NewContents() caches the FileRead() ...
9 years, 8 months ago (2011-04-19 19:36:00 UTC) #2
ncarter (slow)
On 2011/04/19 19:36:00, Marc-Antoine Ruel wrote: > I disagree, the right fix is to modify ...
9 years, 8 months ago (2011-04-19 20:25:47 UTC) #3
ncarter (slow)
On 2011/04/19 20:25:47, ncarter wrote: > On 2011/04/19 19:36:00, Marc-Antoine Ruel wrote: > > I ...
9 years, 8 months ago (2011-04-19 21:15:14 UTC) #4
M-A Ruel
Hey sorry for the delay! LGTM for it, I haven't seen the cache patch uploaded ...
9 years, 8 months ago (2011-04-20 16:04:41 UTC) #5
ncarter (slow)
Thanks for the LGTM. Do you think the timing warnings (the snapshot() ones) are a ...
9 years, 8 months ago (2011-04-20 22:45:25 UTC) #6
M-A Ruel
On 2011/04/20 22:45:25, ncarter wrote: > Thanks for the LGTM. > > Do you think ...
9 years, 8 months ago (2011-04-20 23:27:19 UTC) #7
ncarter (slow)
I had to make changes to get the unit tests to pass. PTAL.
9 years, 8 months ago (2011-04-21 09:55:30 UTC) #8
M-A Ruel
lgtm
9 years, 8 months ago (2011-04-21 20:55:25 UTC) #9
Avi (use Gerrit)
This breaks git. With this change, moving a file in git is not noticed by ...
9 years, 8 months ago (2011-04-21 22:32:24 UTC) #10
ncarter (slow)
Marc-Antoine: I've reproed & fixed the issue that Avi reported; please take another look.
9 years, 8 months ago (2011-04-22 00:52:22 UTC) #11
M-A Ruel
lgtm
9 years, 8 months ago (2011-04-22 01:25:38 UTC) #12
ncarter (slow)
Marc-Antoine: third time. I think my personal share price is tanking this week ...
9 years, 8 months ago (2011-04-22 17:22:35 UTC) #13
M-A Ruel
9 years, 8 months ago (2011-04-23 00:37:28 UTC) #14
lgtm

Powered by Google App Engine
This is Rietveld 408576698