Skip to content
Product Documentation

Improve local build speed with parallel build threads

Arc XP Client developers can now toggle parallelization for faster webpack builds using a arc.config.json file added to the bundle source. This option will speed up the local development builds.

Demo

  • Play

  • How to enable

    To opt-into this capability, add the following to your arc.config.json in the root of your bundle folder:

    {
    "compiler": {
    "parallel": true,
    "devtool": "eval"
    }
    }
    • The parallel property toggles the behavior of webpack running in a single node process with an Array of configs versus spawning a pool of Node processes to run the webpack configurations in parallel. If not present, the default value is false, which is the existing behavior.
    • The devtool property enables users to override the default setting of eval-source-map to eval for faster build times at the cost of source maps. If source maps are not important to your web development workflow, setting the devtool option to eval is the recommended choice for development builds with maximum performance. If not present, the default value is the existing behavior.

    Benchmarks

    We benchmarked this change across a few realistic bundles (using a mix of simple and complex codebases). Here are two examples in total build time numbers (in milliseconds):

    Bundle 1 (requires more memory, such as increased JS Heap size limits):

    Bundle 1

    BaselineWith Parallelization Enabledwith devtool=evalparallelization + devtool=eval
    Run 152102492523669834423
    Run 250410475883157834648
    Run 351095482763200435895
    Average51202483723342634988
    Change from Baseline- 6%- 35%- 32%

    All benchmarks are in total milliseconds to complete the build.

    Bundle2 (complex dependency tree):

    Bundle 2

    BaselineWith Parallelization Enabledwith devtool=evalparallelization + devtool=eval
    Run 186023737345929154119
    Run 285590720316043754900
    Run 386274758226087754997
    Average85962738626020154672
    Change from Baseline- 15%- 30%- 37%

    Even though we see consistent around 30% decrease in total build time, itโ€™s hard to quote a general number, because the compilation performance is highly correlated to the dependencies used and the code structure (number of output types, blocks, and the dependency tree for the webpack entrypoints).