Skip to content

Commit 15f08fe

Browse files
committed
update
1 parent 1247fbc commit 15f08fe

File tree

1 file changed

+50
-51
lines changed

1 file changed

+50
-51
lines changed

README.md

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,54 @@ Codspeed measures performance by cpu instructions.
3737
| parallel | `49.5 ms` (1.00x) | `236.7 ms` (4.78x) |`337.9 ms` (6.83x) |
3838
| single-thread | `29.4 ms` (1.00x) | `113.2 ms` (3.85x) |`167.9 ms` (5.71x) |
3939

40-
#### single-thread
40+
41+
### Run benchmark locally
42+
43+
Run the following command on your machine for replication.
44+
45+
```bash
46+
cargo bench
47+
```
48+
49+
Generate the table
50+
51+
```bash
52+
pnpm i
53+
pnpm run table
54+
```
55+
56+
## Maximum Resident Set Size
57+
58+
```
59+
./memory.sh
60+
61+
./files/cal.com.tsx
62+
oxc 11.5 mb (1.00x)
63+
swc 16.6 mb (1.44x)
64+
biome 22.5 mb (1.95x)
65+
66+
./files/typescript.js
67+
oxc 68.8 mb (1.00x)
68+
swc 92.0 mb (1.34x)
69+
biome 117.4 mb (1.70x)
70+
```
71+
72+
## Setup
73+
74+
* Uses `mimalloc` as the global allocator
75+
* Uses the following release profile
76+
77+
```toml
78+
[profile.release]
79+
opt-level = 3
80+
lto = "fat"
81+
codegen-units = 1
82+
strip = "symbols"
83+
debug = false
84+
panic = "abort"
85+
```
86+
87+
### single-thread
4188

4289
This is the standard benchmark run in a single thread.
4390

@@ -47,7 +94,7 @@ group.bench_with_input(id, &source, |b, source| {
4794
});
4895
```
4996

50-
#### no-drop
97+
### no-drop
5198

5299
This uses the [`iter_with_large_drop`](https://docs.rs/criterion/0.5.1/criterion/struct.Bencher.html#method.iter_with_large_drop) function, which does not take AST drop time into account.
53100
Notice there is only a 0.3ms difference for oxc, but 7ms difference for swc.
@@ -61,7 +108,7 @@ group.bench_with_input(id, &source, |b, source| {
61108
});
62109
```
63110

64-
#### parallel
111+
### parallel
65112

66113
This benchmark uses the total number of physical cores as the total number of files to parse per bench iteration. For example it parses 6 files in parallel on my Mac i7 6 cores.
67114

@@ -77,51 +124,3 @@ group.bench_with_input(id, &source, |b, source| {
77124
})
78125
});
79126
```
80-
81-
## Maximum Resident Set Size
82-
83-
```bash
84-
./memory.sh
85-
86-
./files/cal.com.tsx
87-
oxc 11.5 mb (1.00x)
88-
swc 16.6 mb (1.44x)
89-
biome 22.5 mb (1.95x)
90-
91-
./files/typescript.js
92-
oxc 68.8 mb (1.00x)
93-
swc 92.0 mb (1.34x)
94-
biome 117.4 mb (1.70x)
95-
```
96-
97-
## Run
98-
99-
Run the following command on your machine for replication.
100-
101-
```bash
102-
cargo bench
103-
```
104-
105-
Generate the table
106-
107-
```bash
108-
pnpm i
109-
pnpm run table
110-
```
111-
112-
## Input
113-
114-
* File: https://cdn.jsdelivr.net/npm/[email protected]/lib/typescript.js
115-
* File Size: 7.8M
116-
* Uses `mimalloc` as the global allocator
117-
* Uses the following release profile
118-
119-
```toml
120-
[profile.release]
121-
opt-level = 3
122-
lto = "fat"
123-
codegen-units = 1
124-
strip = "symbols"
125-
debug = false
126-
panic = "abort"
127-
```

0 commit comments

Comments
 (0)