commit | 368c01fcaf6dac387152b5093b885f70961d3b9d | [log] [tgz] |
---|---|---|
author | Bruce Dawson <brucedawson@chromium.org> | Fri Dec 02 00:39:07 2022 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Dec 02 00:39:07 2022 |
tree | 81dbea5982b7ef5063136ae5a137dfb9b9690d29 | |
parent | f761e68b582ed2df92808c5affd41c0671737710 [diff] |
Optimize AddedJsFilesCheck AddedJsFilesCheck invokes two filter functions, one that is passed in and one that is local. It was invoking the passed-in function first which is not ideal because that function may be expensive and if it is called first it will be invoked on every file in the change. This change reverses the order so that the local function is called first. This works well because this function is cheap, and it rejects a lot of files, thus reducing the load on the passed in function. This makes CheckNoNewJs run about ten times faster (2.5 s instead of 25 s when tested with presubmit --all). Some of the speedup (from 3.5s to 2.5s) is from making the local filter function even lighter weight. While investigating this I noticed that CheckNoNewJs would fail if CheckWebDevStyle wasn't run first, so this change also fixes that by pulling out a function to import presubmit_support. Change-Id: I2fb9d480fe0f0978210ba5cf3bf2b7cd0f65e010 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4067910 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/main@{#1078379}
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.