Skip to content
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

chore(benchmark): add radix-ui.jsx as a real world jsx example #2304

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Feb 4, 2024

Following #2297, this adds another benchmark.

This one is from radix-ui website. I've chosen this particular file because it differs from the other benchmark sources in 3 ways:

  1. JSX not TSX (despite the file extension).
  2. Contains no logic, only JSX component hierarchy, and content text.
  3. Very small (60 LOC).

The last is particularly important, I think. Often developers will be working on small files (single component per file convention). And some possible directions for the parser (SIMD etc) involve optimizing chewing through chunks of text, with a de-opt at the end to process the final batch of bytes. If that imposes a penalty on short files, this benchmark will surface it.

Copy link

netlify bot commented Feb 4, 2024

Deploy Preview for oxc canceled.

Name Link
🔨 Latest commit c44c90b
🔍 Latest deploy log https://app.netlify.com/sites/oxc/deploys/65bff2a31688d50008304f51

Copy link

codspeed-hq bot commented Feb 4, 2024

CodSpeed Performance Report

Merging #2304 will not alter performance

Comparing overlookmotel:benches (37cfb48) with main (018674c)

Summary

✅ 22 untouched benchmarks

🆕 5 new benchmarks

Benchmarks breakdown

Benchmark main overlookmotel:benches Change
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 203.5 µs N/A
🆕 transformer[RadixUIAdoptionSection.jsx] N/A 829.7 µs N/A
🆕 semantic[RadixUIAdoptionSection.jsx] N/A 399.9 µs N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 5.3 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 432.6 µs N/A

@Boshen
Copy link
Member

Boshen commented Feb 5, 2024

Let me copy this file over to oxc-project/benchmark-files, since this file can change overtime.

@Boshen Boshen enabled auto-merge (squash) February 5, 2024 05:42
@Boshen Boshen disabled auto-merge February 5, 2024 05:42
@Boshen Boshen merged commit 73ec4df into oxc-project:main Feb 5, 2024
16 checks passed
@overlookmotel
Copy link
Contributor Author

Ah of course, I didn't consider that the files could change. Doh! I should have used a permalink.

If you prefer to avoid hosting the files in an OXC repo, here's the permalink for the one I added:

https://raw.githubusercontent.com/radix-ui/website/6cf13bab6e56e8814f8e5cac156587c0fefe994d/components/marketing/AdoptionSection.tsx

Not sure which file you took from cal.com, but could take the same approach for that.

If you want to, let me know which file and I'll make a PR.

@Boshen
Copy link
Member

Boshen commented Feb 5, 2024

It's already done ;-)

@overlookmotel
Copy link
Contributor Author

OK cool!

@overlookmotel overlookmotel deleted the benches branch February 5, 2024 12:46
IWANABETHATGUY pushed a commit to IWANABETHATGUY/oxc that referenced this pull request May 29, 2024
…roject#2304)

Following oxc-project#2297, this adds another benchmark.

This one is from radix-ui website. I've chosen this particular file
because it differs from the other benchmark sources in 3 ways:

1. JSX not TSX (despite the file extension).
2. Contains no logic, only JSX component hierarchy, and content text.
3. Very small (60 LOC).

The last is particularly important, I think. Often developers will be
working on small files (single component per file convention). And some
possible directions for the parser (SIMD etc) involve optimizing chewing
through chunks of text, with a de-opt at the end to process the final
batch of bytes. If that imposes a penalty on short files, this benchmark
will surface it.

---------

Co-authored-by: Boshen <[email protected]>
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