Skip to content

deno compile --include-code-cache #26979

Open
Open
@felipecrs

Description

Surfing on the new deno compile --include-style flags, it would be great if the compiled binary could have its own code cache included.

Code cache right now will only cache in the first execution and then reuse it in subsequent ones.

As I had stated here, this new flag would make a lot of sense in ephemeral environments like docker containers, where the first execution is also the only execution, rendering code cache a bit useless in this scenario (to be fair, it should be able to work around the issue by running the application once during docker build, but running an application isn't always ok to do).

On my tests on some application, the code cache seems very small:

# let's make sure we don't have any prior cachedeno clean
Removed /home/felipecrs/.cache/deno (7569 files, 86.04MB)./pkgx-cc --syncdeno clean
Removed /home/felipecrs/.cache/deno (4 files, **76.27KB)**

Only 76.27 KB in this example. A negligible size increase considering the whole binary size.

Maybe it should be even made the default?

Metadata

Assignees

No one assigned

    Labels

    compilerelated to the `deno compile` featurefeatnew feature (which has been agreed to/accepted)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions