Skip to content

Enable strip_source when compiling to bytecode - #1242

Draft
jeffcharles wants to merge 1 commit into
mainfrom
jc.strip-source
Draft

Enable strip_source when compiling to bytecode#1242
jeffcharles wants to merge 1 commit into
mainfrom
jc.strip-source

Conversation

@jeffcharles

@jeffcharles jeffcharles commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Description of the change

Enable strip_source when compiling JS source code to QuickJS bytecode. When strip_source is disabled (the default behaviour), a copy of the source code is included in the QuickJS bytecode. The source code is used for operations like function.prototype.toString(). I don't think this should impact profiling.

I've also added some automated tests to ensure the Wasm modules don't increase in size too much. I'm happy to tweak the percentage threshold.

This is still a draft while I figure out if I need to bump the plugin version.

Why am I making this change?

We observed that the size of the QuickJS bytecode for the same source code was often substantially larger than with the previously released version of Javy. I've observed it being 30% to 70% larger on real-world test cases I've given it and I've seen one reported case I haven't verified where the bytecode size quadrupled. It looks like this was related to changing to quickjs-ng where it started to default to including source code in the bytecode](quickjs-ng/quickjs#218).

Checklist

  • I've updated the default plugin import namespace and incremented the major version of javy-plugin-api if the QuickJS bytecode has changed.
  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli, javy-plugin, and javy-plugin-processing do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.

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