Skip to content

Add default feature for JIT #589

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jschwe
Copy link
Member

@jschwe jschwe commented Jul 7, 2025

This is a revival of #523 - but with a slightly different background.
When building servo on Linux with the profile production-stripped, disabling JIT with this change shaves off 9MiB from the servo binary size, which is around 10% (80MiB vs. 89MiB).

@jschwe jschwe force-pushed the flag_disable_jit2 branch from aaa15be to 19b4bd4 Compare July 7, 2025 06:49
@jschwe jschwe force-pushed the flag_disable_jit2 branch from 19b4bd4 to 1d4f3f0 Compare July 10, 2025 01:41
When building servo on Linux with the profile `production-stripped`,
disabling JIT with this change shaves off 9MiB from the servo binary
size, which is around 10%.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe force-pushed the flag_disable_jit2 branch from 1d4f3f0 to 86b5a64 Compare July 10, 2025 01:53
@@ -12,6 +12,7 @@ doctest = false

[features]
debugmozjs = ['mozjs_sys/debugmozjs']
jit = ['mozjs_sys/jit']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a default feature for the mozjs crate as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the default feature to mozjs and removed it as default feature from mozjs_sys. Otherwise we couldn't disable it, unless mozjs would depend on monz_js_sys with default-features = false. Since I don't think there would be any other users of the sys crate, besides mozjs, I think it makes the most sense to expose the jit feature as default in mozjs and don't add any default features to mozjs_sys.
What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I agree!

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
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.

2 participants