Commit fafd754
authored
**Description:**
As the `ProgramData.vars` is re-allocated lots of time, we can reduce `memmove` operations by boxing the `VarUsageInfo`. This is because the hash map would need to allocate, e.g., `1024 * size_of<Box<T>>` instead of `1024 * size_of<VarUsageInfo>` while incrementing the size of the hash map from 512 to 1024.
```
Benchmarking es/minifier/libs/es/minifier/libs/antd
Benchmarking es/minifier/libs/es/minifier/libs/antd: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/antd: Collecting 10 samples in estimated 9.7340 s (20 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/antd: Analyzing
es/minifier/libs/es/minifier/libs/antd
time: [489.01 ms 490.05 ms 490.97 ms]
change: [-1.5287% -1.2158% -0.9269%] (p = 0.00 < 0.05)
Change within noise threshold.
Benchmarking es/minifier/libs/es/minifier/libs/d3
Benchmarking es/minifier/libs/es/minifier/libs/d3: Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 6.4s or enable flat sampling.
Benchmarking es/minifier/libs/es/minifier/libs/d3: Collecting 10 samples in estimated 6.4406 s (55 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/d3: Analyzing
es/minifier/libs/es/minifier/libs/d3
time: [116.67 ms 117.18 ms 117.78 ms]
change: [-0.3332% +0.5408% +1.3860%] (p = 0.27 > 0.05)
No change in performance detected.
Found 1 outliers among 10 measurements (10.00%)
1 (10.00%) low mild
Benchmarking es/minifier/libs/es/minifier/libs/echarts
Benchmarking es/minifier/libs/es/minifier/libs/echarts: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/echarts: Collecting 10 samples in estimated 8.4715 s (20 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/echarts: Analyzing
es/minifier/libs/es/minifier/libs/echarts
time: [424.80 ms 425.63 ms 426.53 ms]
change: [-0.8302% -0.5287% -0.2551%] (p = 0.00 < 0.05)
Change within noise threshold.
Benchmarking es/minifier/libs/es/minifier/libs/jquery
Benchmarking es/minifier/libs/es/minifier/libs/jquery: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/jquery: Collecting 10 samples in estimated 6.4860 s (165 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/jquery: Analyzing
es/minifier/libs/es/minifier/libs/jquery
time: [39.416 ms 39.525 ms 39.635 ms]
change: [-1.1709% -0.3682% +0.3550%] (p = 0.37 > 0.05)
No change in performance detected.
Found 2 outliers among 10 measurements (20.00%)
1 (10.00%) low mild
1 (10.00%) high mild
Benchmarking es/minifier/libs/es/minifier/libs/lodash
Benchmarking es/minifier/libs/es/minifier/libs/lodash: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/lodash: Collecting 10 samples in estimated 5.4512 s (110 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/lodash: Analyzing
es/minifier/libs/es/minifier/libs/lodash
time: [48.916 ms 49.027 ms 49.132 ms]
change: [-0.3397% +0.1751% +0.7892%] (p = 0.55 > 0.05)
No change in performance detected.
Found 3 outliers among 10 measurements (30.00%)
1 (10.00%) low severe
1 (10.00%) high mild
1 (10.00%) high severe
Benchmarking es/minifier/libs/es/minifier/libs/moment
Benchmarking es/minifier/libs/es/minifier/libs/moment: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/moment: Collecting 10 samples in estimated 6.0985 s (275 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/moment: Analyzing
es/minifier/libs/es/minifier/libs/moment
time: [21.975 ms 22.097 ms 22.180 ms]
change: [-0.5825% -0.0376% +0.4977%] (p = 0.89 > 0.05)
No change in performance detected.
Benchmarking es/minifier/libs/es/minifier/libs/react
Benchmarking es/minifier/libs/es/minifier/libs/react: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/react: Collecting 10 samples in estimated 5.2885 s (770 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/react: Analyzing
es/minifier/libs/es/minifier/libs/react
time: [6.8318 ms 6.8407 ms 6.8490 ms]
change: [-0.9893% -0.4427% +0.0059%] (p = 0.12 > 0.05)
No change in performance detected.
Found 1 outliers among 10 measurements (10.00%)
1 (10.00%) high severe
Benchmarking es/minifier/libs/es/minifier/libs/terser
Benchmarking es/minifier/libs/es/minifier/libs/terser: Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 5.2s or enable flat sampling.
Benchmarking es/minifier/libs/es/minifier/libs/terser: Collecting 10 samples in estimated 5.2464 s (55 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/terser: Analyzing
es/minifier/libs/es/minifier/libs/terser
time: [94.771 ms 95.388 ms 96.051 ms]
change: [-0.1542% +0.7131% +1.6361%] (p = 0.15 > 0.05)
No change in performance detected.
Benchmarking es/minifier/libs/es/minifier/libs/three
Benchmarking es/minifier/libs/es/minifier/libs/three: Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 8.5s or enable flat sampling.
Benchmarking es/minifier/libs/es/minifier/libs/three: Collecting 10 samples in estimated 8.4619 s (55 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/three: Analyzing
es/minifier/libs/es/minifier/libs/three
time: [153.14 ms 153.68 ms 154.43 ms]
change: [-0.9029% -0.0544% +0.8860%] (p = 0.92 > 0.05)
No change in performance detected.
Found 1 outliers among 10 measurements (10.00%)
1 (10.00%) high mild
Benchmarking es/minifier/libs/es/minifier/libs/typescript
Benchmarking es/minifier/libs/es/minifier/libs/typescript: Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 9.7s.
Benchmarking es/minifier/libs/es/minifier/libs/typescript: Collecting 10 samples in estimated 9.7210 s (10 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/typescript: Analyzing
es/minifier/libs/es/minifier/libs/typescript
time: [967.74 ms 972.37 ms 976.98 ms]
change: [-1.5382% -0.6114% +0.2760%] (p = 0.22 > 0.05)
No change in performance detected.
Benchmarking es/minifier/libs/es/minifier/libs/victory
Benchmarking es/minifier/libs/es/minifier/libs/victory: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/victory: Collecting 10 samples in estimated 6.7932 s (30 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/victory: Analyzing
es/minifier/libs/es/minifier/libs/victory
time: [226.69 ms 227.27 ms 227.88 ms]
change: [-1.1037% -0.7390% -0.3683%] (p = 0.00 < 0.05)
Change within noise threshold.
Benchmarking es/minifier/libs/es/minifier/libs/vue
Benchmarking es/minifier/libs/es/minifier/libs/vue: Warming up for 3.0000 s
Benchmarking es/minifier/libs/es/minifier/libs/vue: Collecting 10 samples in estimated 5.9418 s (110 iterations)
Benchmarking es/minifier/libs/es/minifier/libs/vue: Analyzing
es/minifier/libs/es/minifier/libs/vue
time: [53.880 ms 53.961 ms 54.118 ms]
change: [-1.2002% -0.0320% +0.9082%] (p = 0.96 > 0.05)
No change in performance detected.
Found 1 outliers among 10 measurements (10.00%)
```
1 parent 477897f commit fafd754
File tree
4 files changed
+16
-6
lines changed- .changeset
- crates/swc_ecma_minifier/src
- compress/optimize
4 files changed
+16
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
323 | 325 | | |
324 | 326 | | |
325 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | | - | |
343 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| |||
0 commit comments