• Andreas Haas's avatar
    [wasm] Run sync compilation with kUserBlocking priority · a7e8c320
    Andreas Haas authored
    With the recent switch from the tasks API to the jobs API for thread
    management within WebAssembly compilation we got the problem that
    TurboFan compilation of a previous compilation can block the Liftoff
    compilation of a new compilation. With synchronous compilation, this can
    cause significant delays for the user. With this CL we increase the
    priority of synchronous compilation so that at least synchronous
    compilation can only be blocked by other synchronous compilation. This
    fixes issues that we saw on autocad.
    
    Why is it okay to increase the priority of synchronous compilation?
    * On the main thread, synchronous compilation is only allowed for small
      modules which should not take long to compile. Also, the compilation
      blocks the main thread and should finish as fast as possible.
    * On worker threads, delaying other background work is not such a big
      issue.
    
    Downsides:
    * This does not only increase the priority of the initial compilation,
      but also for the TurboFan optimization. Similar to above, for small
      modules on the main thread this should not be a big deal because
      compilation is fast. Big modules can only be compiled on worker
      threads.
    
    Note that this is supposed to be a fix for the problems we see at the
    moment with autocad on stable and beta. Eventually compilation job
    management should be done by the wasm engine for all WebAssembly
    compilation, so that not each WebAssemly module has to do its own
    compilation job management.
    
    R=clemensb@chromium.org
    
    Bug: chromium:1142686, v8:11088
    Change-Id: Iee4948b2fcad944f587918e9452e6888258857f9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512911
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70923}
    a7e8c320
compilation-environment.h 5.29 KB