commit | 6cc154e0312d0e8042052c5d04122360028d4f4b | [log] [tgz] |
---|---|---|
author | Bruce Dawson <[email protected]> | Tue Apr 12 20:39:49 2022 |
committer | Chromium LUCI CQ <[email protected]> | Tue Apr 12 20:39:49 2022 |
tree | 20097b03749e717ca7848179dc347ca552dd65ad | |
parent | 1cc83f6a3ef2d3f9983023c8a585b74e0686adff [diff] |
Make CheckForIncludeGuards ~100x faster This takes CheckForIncludeGuards from being the most expensive presubmit to being quite unremarkable. CheckForIncludeGuards uses "if not f.OldContents()" to see whether a file is new or not. It turns out that this is a fairly expensive function. At the very least it has to retrieve the contents of the old file and then call .splitlines() on it, which is a lot of work when all that matters is whether the file exists or not. A faster DoesOldContentsExist() function would be nice but is not even needed because the check that follows is almost never True. So, reversing the order of the checks gets rid of ~99.9% of the calls to OldContents(), thus taking CheckForIncludeGuards()'s execution time when run on all files from about 50 minutes to about half a minute. Bug: 1309977 Change-Id: I848db84e67384830cda4fcfcc50d6bb13e7830ea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3583076 Reviewed-by: Erik Staab <[email protected]> Commit-Queue: Bruce Dawson <[email protected]> Cr-Commit-Position: refs/heads/main@{#991709}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.