• Peter Wen's avatar
    Android: Use fine-grain dependencies for desugar · 1be31db3
    Peter Wen authored
    D8 provides a list of dependent/dependency relationships for desugaring.
    When a file changes (whether within the target or on the classpath), the
    classes within the target that implement it will need to be re-desugared
    even though those classes did not change. Previously we would re-desugar
    all classes within the target. Now we can just re-desugar (i.e. re-dex)
    only the necessary ones.
    
    This provides a build speed boost primarily due to avoiding the need to
    run any desugaring (either bazel desugar or D8 desugar) when a change
    does not require it.
    
    A follow-up CL will deal with the DexSplitter issue for monochrome and
    trichrome bundle builds.
    
    The stats below are timed with android_fast_local_dev=true.
    Before:
    chrome_java_nosig: 34.5s avg (34.1s, 35.2s, 34.2s, 34.4s)
    chrome_java_sig: 36.2s avg (35.0s, 37.0s, 36.4s, 36.4s)
    chrome_java_res: 39.8s avg (39.8s, 39.9s, 39.6s, 40.0s)
    base_java_nosig: 46.0s avg (46.9s, 46.0s, 45.0s, 46.1s)
    base_java_sig: 107.2s avg (106.8s, 106.9s, 107.7s, 107.3s)
    
    After:
    chrome_java_nosig: 31.6s avg (32.5s, 31.1s, 31.7s, 31.2s)
    chrome_java_sig: 34.0s avg (34.2s, 34.0s, 33.8s, 34.1s)
    chrome_java_res: 39.8s avg (39.8s, 39.6s, 39.9s, 39.8s)
    base_java_nosig: 22.7s avg (22.5s, 23.1s, 22.3s, 22.8s)
    base_java_sig: 101.3s avg (102.0s, 101.2s, 100.9s, 101.2s)
    
    Bug: 1015559
    Change-Id: Idf4e05bf41583b2ea7d4f1d3855b508be56eea94
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2633323
    Commit-Queue: Peter Wen <wnwen@chromium.org>
    Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#844873}
    1be31db3