Skip to content

Conversation

@j-malt
Copy link
Contributor

@j-malt j-malt commented Oct 31, 2025

What changed / motivation ?

In #1303 I began adding support for defineConsts to 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 defineConsts usage to the benchmark package in the create-complex file. 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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 31, 2025
@mellyeliu mellyeliu merged commit 4c02d20 into facebook:main Nov 5, 2025
6 of 9 checks passed
hiteshshetty-dev pushed a commit to hiteshshetty-dev/stylex that referenced this pull request Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants