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

deno compile --include-code-cache #26979

Open
felipecrs opened this issue Nov 21, 2024 · 1 comment
Open

deno compile --include-code-cache #26979

felipecrs opened this issue Nov 21, 2024 · 1 comment
Labels
compile related to the `deno compile` feature feat new feature (which has been agreed to/accepted)

Comments

@felipecrs
Copy link

felipecrs commented Nov 21, 2024

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?

@dsherret dsherret added feat new feature (which has been agreed to/accepted) compile related to the `deno compile` feature labels Nov 21, 2024
@felipecrs
Copy link
Author

felipecrs commented Nov 21, 2024

Correction: this is the actual code cache:

ls -lha /tmp/deno-compile-*
-rw-r--r-- 1 felipecrs felipecrs 1.8M Nov 21 14:12 /tmp/deno-compile-pkgx-cc.cache

And the size is not just some KBs, but instead a few MBs. I think it's still very acceptable to be bundled by some applications, but I guess it's a good reason not to do it by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile related to the `deno compile` feature feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

No branches or pull requests

2 participants