dart-sdk/pkg/frontend_server/bin
Michael Richards 1cd8b28cfe [frontend_server] This adds the ability for the frontend server to be a resident process, allowing it to live through invocations of the Dart CLI. This allows the CLI to utilize the frontend's incremental compilation mode and keep cached kernel files for better performance. This currently only supports VM targets.
When launched as a snapshot, the initial compile is slower than the existing pub approach because of a process start time of around 500 ms. When launched as a compiled executable, initial compile times are the same as the existing pub approach. Once launched, experimental results show times to produce a kernel file of at worst 1.5-2x faster than pub's solution and at best 10x faster than pub's solution. The typical workflow of making changes and recompiling results in an average of a 5x speedup with respect to pub's implementation.

Because compiler instances use a lot of memory, there is a limit on the number of active compilers that the resident server will keep alive, and will actively bring instances down when this limit is exceeded. If the user was previously compiling a given project during the lifespan of a ResidentFrontendServer and its compiler is taken down between requests, a new compiler instance will be allocated for the request. Performance is still between 1.5x-5x faster for this case when compared to pub's compile times.

Change-Id: If9ee1ecc71d660d34faf23381c764dc11d6a5902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252001
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-08-02 18:08:21 +00:00
..
frontend_server_starter.dart [frontend_server] This adds the ability for the frontend server to be a resident process, allowing it to live through invocations of the Dart CLI. This allows the CLI to utilize the frontend's incremental compilation mode and keep cached kernel files for better performance. This currently only supports VM targets. 2022-08-02 18:08:21 +00:00