• Yang Guo's avatar
    [compiler] finalize compile jobs asap when compiling on main thread · 0a7e08ef
    Yang Guo authored
    Previously, we finalize all compile jobs at once. This keeps the zone memory
    in every compile job alive until the end. This contributes to a high peak
    memory when many functions are compiled eagerly, for example when producing
    cache data for the ServiceWorker cache.
    
    Memory tracked by the AccountingAllocator in bytes, prior to this change in
    the test case:
    peak memory after init:              8192
    peak memory after lazy compile:     41200
    peak memory after lazy compile:     41200
    peak memory after eager compile:   164256
    
    With this change, if we are compiling on the main thread, we finalize every
    compile job as soon as it is done and dispose the compile job and its zone
    memory.
    
    After this change:
    peak memory after init:              8192
    peak memory after lazy compile:     41200
    peak memory after lazy compile:     41200
    peak memory after eager compile:    41376
    
    R=leszeks@chromium.org, rmcilroy@chromium.org
    
    Bug: chromium:901329
    Change-Id: Iae0c89396c89692c4ecdeec3970d3c62031d2bce
    Reviewed-on: https://chromium-review.googlesource.com/c/1322949
    Commit-Queue: Yang Guo <yangguo@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#57340}
    0a7e08ef
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...