Skip to content

Bundle Size Reduction Metrics Report#1

Open
yumin-chen wants to merge 1 commit intomasterfrom
feature/bundle-size-metrics-7160713914852699681
Open

Bundle Size Reduction Metrics Report#1
yumin-chen wants to merge 1 commit intomasterfrom
feature/bundle-size-metrics-7160713914852699681

Conversation

@yumin-chen
Copy link
Copy Markdown
Owner

I have analyzed the impact of the flags -fno-eval -fno-regexp -fno-json -fno-module-loader on the bundle size of QuickJS executables.

By compiling several examples (hello.js, hello_module.js, pi_bigint.js) with and without these flags (using -flto -s for both), I observed an absolute reduction of approximately 1.6 MB per executable, which corresponds to a 33% decrease in size for typical small scripts.

The reduced binaries were verified to work correctly for the provided examples.


PR created automatically by Jules for task 7160713914852699681 started by @yumin-chen

Tested -fno-eval -fno-regexp -fno-json -fno-module-loader on examples and
found a consistent ~1.6 MB (33%) reduction in executable size when
using LTO and stripping.

Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@yumin-chen
Copy link
Copy Markdown
Owner Author

yumin-chen commented Mar 25, 2026

Can we safely remove the parser and compiler from runtime too when -fno-eval -fno-regexp -fno-json -fno-module-loader are enabled, since I believe these are the only features that require runtime parser/compiler? There's no other edge cases where parser/compiler is needed by the runtime? How can you test thorough removal won't affect these edge cases when parser/compiler is still requiqred at runtime and must be retained?

@yumin-chen
Copy link
Copy Markdown
Owner Author

When -fno-eval -fno-regexp -fno-json -fno-module-loader are enabled, they signal user intent to explicitly disable certain features from both runtime and build-time, meaning the entire engine full removal, and the user does not need these features either buildtime or runtime.

So a combination of all -fno-eval -fno-regexp -fno-json -fno-module-loader means simultaneously disabling all possibility/references where runtime parser/compiler is used, and we could further minimise the bundling size of qjsc by removing the parser/compiler from the runtime while still keeping the full engine available as dev toolchain.

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.

1 participant