• Bruce Dawson's avatar
    Don't do double-serial Pylint checks · 0af70977
    Bruce Dawson authored
    Pylint uses parallelism to improve performance, but high startup costs
    means that this only makes sense if there are lots of files to be
    processed. So, a while ago a change was made such that if there are
    fewer than ten files to be analyzed then no parallelism is used.
    
    Our Pylint wrapper also has a hack where it does one type of check in
    serial mode, because that is the only time it is reliable. This
    requires running Pylint twice, which is expensive.
    
    If there are a small enough number of files to analyze then we will be
    doing serial analysis anyway, so there is no need to do two separate
    runs. In this test case:
    
      git cl presubmit -v --files tools\code_coverage\create_js_source_maps\test\create_js_source_maps_test.py
    
    the cost of Pylint is dropped roughly in half, from six seconds to
    three seconds, by eliminating one of the three-second runs.
    
    Bug: 1309977
    Change-Id: I2e5e96a86d1d76b127f481af7478d807c042b609
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3812436Reviewed-by: 's avatarAravind Vasudevan <aravindvasudev@google.com>
    Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
    0af70977
presubmit_canned_checks.py 74.5 KB