Skip to content

Commit

Permalink
chore(benchmark): add radix-ui.jsx as a real world jsx example (#2304)
Browse files Browse the repository at this point in the history
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.

---------

Co-authored-by: Boshen <[email protected]>
  • Loading branch information
overlookmotel and Boshen authored Feb 5, 2024
1 parent f3035f1 commit 73ec4df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/common/src/test_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ impl TestFiles {
let files = [
// TypeScript syntax (2.81MB)
"https://raw.githubusercontent.com/microsoft/TypeScript/v5.3.3/src/compiler/checker.ts",
// Realword tsx (1.0M)
// Real world app tsx (1.0M)
"https://raw.githubusercontent.com/oxc-project/benchmark-files/main/cal.com.tsx",
// Real world content-heavy app jsx (3K)
"https://raw.githubusercontent.com/oxc-project/benchmark-files/main/RadixUIAdoptionSection.jsx",
// Heavy with classes (554K)
"https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.mjs",
// ES5 (3.9M)
Expand Down

0 comments on commit 73ec4df

Please sign in to comment.