Add defineConsts usage to benchmark#1312
Merged
mellyeliu merged 3 commits intofacebook:mainfrom Nov 5, 2025
Merged
Conversation
2 tasks
mellyeliu
approved these changes
Nov 5, 2025
hiteshshetty-dev
pushed a commit
to hiteshshetty-dev/stylex
that referenced
this pull request
Nov 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed / motivation ?
In #1303 I began adding support for
defineConststo be nested, which requires changing some of the eval code in the Babel plugin. I don't expect that it should harm performance much, but it'd be good to be able to confirm that I'm not introducing a major regression.This just adds a simple
defineConstsusage to the benchmark package in thecreate-complexfile. I'll rebase #1303 on this and add some nested usages.Additional Context
I'm seeing a pretty significant drop in the "complex create" execs/sec after this change. I suppose that's to be expected.
Main branch
{ "babel-plugin: stylex.create": { "basic create": "1959", "complex create": "536" }, "babel-plugin: stylex.createTheme": { "basic themes": "1171", "complex themes": "100" } }This branch
{ "babel-plugin: stylex.create": { "basic create": "1927", "complex create": "146" }, "babel-plugin: stylex.createTheme": { "basic themes": "1200", "complex themes": "103" } }Pre-flight checklist
Contribution Guidelines