Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create compile caches on compile step #3004

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Oct 25, 2024

Work in progress.

The goal of this pull-request is to create an intermediary step between TypeScript compiler and Workerd compilation step to create compile caches. Compile caches will be used by the main binary to improve the startup time of the built-in modules (and only the built-ins).

Technical details:

The newly introduced binary accepts a string to the path of a file list that contains every path to be compile cached. With the current change the build process will slightly change to the following:

  1. Workerd runs typescript and compiles TS files.
  2. Each node.js built-in will be passed to the newly introduced binary to create a compile cache for the given paths.
  3. Workerd will be compiled and it will use the compile cache output from the creator binary if exists.

Limitations:

  • Currently, we only enable it for Linux. We can enable it for Windows, but since we're only using Linux on production, I don't think it's beneficial to support Windows.
  • We need to handle downstream repository and the isolate creation differences.

@anonrig anonrig requested review from mikea and jasnell October 25, 2024 20:07
@anonrig anonrig force-pushed the yagiz/create-compile-cache-step branch 7 times, most recently from 651bc4e to ac911a3 Compare October 28, 2024 15:47
build/wd_compile_cache.bzl Outdated Show resolved Hide resolved
build/wd_compile_cache.bzl Outdated Show resolved Hide resolved
build/wd_compile_cache.bzl Outdated Show resolved Hide resolved
build/wd_compile_cache.bzl Outdated Show resolved Hide resolved
@anonrig anonrig force-pushed the yagiz/create-compile-cache-step branch 2 times, most recently from 4e5b2c9 to 9417577 Compare October 28, 2024 17:18
build/wd_compile_cache.bzl Outdated Show resolved Hide resolved
src/workerd/tools/BUILD.bazel Outdated Show resolved Hide resolved
src/workerd/tools/BUILD.bazel Outdated Show resolved Hide resolved
src/workerd/tools/create-compile-cache.c++ Outdated Show resolved Hide resolved
@anonrig anonrig force-pushed the yagiz/create-compile-cache-step branch 2 times, most recently from 515dc86 to 902521e Compare October 29, 2024 14:07
@anonrig anonrig force-pushed the yagiz/create-compile-cache-step branch from 523aecd to b0b30c0 Compare October 29, 2024 18:50
@anonrig anonrig force-pushed the yagiz/create-compile-cache-step branch from b0b30c0 to 9a27009 Compare October 29, 2024 21:06
@anonrig anonrig requested a review from kentonv October 29, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants