File tree 5 files changed +18
-0
lines changed
5 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,10 @@ impl From<&Function> for FnMetadata {
318
318
319
319
impl Optimizer < ' _ > {
320
320
fn may_remove_ident ( & self , id : & Ident ) -> bool {
321
+ if self . ctx . is_exported {
322
+ return false ;
323
+ }
324
+
321
325
if id. span . ctxt != self . marks . top_level_ctxt {
322
326
return true ;
323
327
}
Original file line number Diff line number Diff line change
1
+ const a = ( ) => "" ;
2
+ const b = { } ;
3
+ export const c = a ;
4
+ b . c = c ;
Original file line number Diff line number Diff line change
1
+ export const c = ( ) => "" ;
Original file line number Diff line number Diff line change
1
+ export const a = 4 ;
2
+ export const b = 16 ;
3
+ export const c = 5 ;
4
+
5
+ export const d = ( ) => a ;
Original file line number Diff line number Diff line change
1
+ export const a = 4 ;
2
+ export const b = 16 ;
3
+ export const c = 5 ;
4
+ export const d = ( ) => 4 ;
You can’t perform that action at this time.
1 commit comments
github-actions[bot] commentedon Aug 25, 2023
Benchmark
es/full/bugs-1
293441
ns/iter (± 10562
)287059
ns/iter (± 5446
)1.02
es/full/minify/libraries/antd
1296795251
ns/iter (± 14083013
)1335784926
ns/iter (± 11037304
)0.97
es/full/minify/libraries/d3
278926065
ns/iter (± 8514939
)271052343
ns/iter (± 835235
)1.03
es/full/minify/libraries/echarts
1076507517
ns/iter (± 34170502
)1068458287
ns/iter (± 5661637
)1.01
es/full/minify/libraries/jquery
85031207
ns/iter (± 2594964
)83750864
ns/iter (± 269133
)1.02
es/full/minify/libraries/lodash
98329110
ns/iter (± 2898292
)96862912
ns/iter (± 392969
)1.02
es/full/minify/libraries/moment
49820943
ns/iter (± 3533575
)50361207
ns/iter (± 718046
)0.99
es/full/minify/libraries/react
17929671
ns/iter (± 45691
)18166982
ns/iter (± 1629786
)0.99
es/full/minify/libraries/terser
217763947
ns/iter (± 1244684
)224648452
ns/iter (± 5967691
)0.97
es/full/minify/libraries/three
387753216
ns/iter (± 4070575
)403462365
ns/iter (± 7877761
)0.96
es/full/minify/libraries/typescript
2647726695
ns/iter (± 18474506
)2681459490
ns/iter (± 41927160
)0.99
es/full/minify/libraries/victory
595795844
ns/iter (± 11272585
)565800517
ns/iter (± 29906697
)1.05
es/full/minify/libraries/vue
118789353
ns/iter (± 592012
)119039170
ns/iter (± 2081115
)1.00
es/full/codegen/es3
34400
ns/iter (± 90
)34433
ns/iter (± 85
)1.00
es/full/codegen/es5
34443
ns/iter (± 151
)34470
ns/iter (± 65
)1.00
es/full/codegen/es2015
34375
ns/iter (± 76
)34471
ns/iter (± 96
)1.00
es/full/codegen/es2016
34406
ns/iter (± 72
)34460
ns/iter (± 42
)1.00
es/full/codegen/es2017
34377
ns/iter (± 97
)34481
ns/iter (± 46
)1.00
es/full/codegen/es2018
34415
ns/iter (± 91
)34460
ns/iter (± 96
)1.00
es/full/codegen/es2019
34393
ns/iter (± 36
)34458
ns/iter (± 88
)1.00
es/full/codegen/es2020
34411
ns/iter (± 64
)34479
ns/iter (± 74
)1.00
es/full/all/es3
165812121
ns/iter (± 1293622
)166713176
ns/iter (± 950896
)0.99
es/full/all/es5
158122612
ns/iter (± 756388
)159065295
ns/iter (± 1133921
)0.99
es/full/all/es2015
118099735
ns/iter (± 934199
)119133839
ns/iter (± 395117
)0.99
es/full/all/es2016
117008101
ns/iter (± 497404
)118436382
ns/iter (± 507836
)0.99
es/full/all/es2017
116625625
ns/iter (± 542479
)117611864
ns/iter (± 675452
)0.99
es/full/all/es2018
114742090
ns/iter (± 643420
)115742539
ns/iter (± 589060
)0.99
es/full/all/es2019
113561416
ns/iter (± 720599
)115060756
ns/iter (± 554440
)0.99
es/full/all/es2020
109315739
ns/iter (± 374199
)110737098
ns/iter (± 692000
)0.99
es/full/parser
487416
ns/iter (± 5239
)490745
ns/iter (± 4934
)0.99
es/full/base/fixer
18307
ns/iter (± 217
)19476
ns/iter (± 184
)0.94
es/full/base/resolver_and_hygiene
80202
ns/iter (± 106
)81386
ns/iter (± 278
)0.99
serialization of serde
296
ns/iter (± 0
)291
ns/iter (± 0
)1.02
css/minify/libraries/bootstrap
29193942
ns/iter (± 85993
)29186512
ns/iter (± 49216
)1.00
css/visitor/compare/clone
1639121
ns/iter (± 5617
)1630606
ns/iter (± 4065
)1.01
css/visitor/compare/visit_mut_span
1770976
ns/iter (± 2438
)1763670
ns/iter (± 2921
)1.00
css/visitor/compare/visit_mut_span_panic
1841777
ns/iter (± 5183
)1847509
ns/iter (± 98668
)1.00
css/visitor/compare/fold_span
2582315
ns/iter (± 10484
)2570611
ns/iter (± 7333
)1.00
css/visitor/compare/fold_span_panic
2761164
ns/iter (± 11017
)2759629
ns/iter (± 8177
)1.00
css/lexer/bootstrap_5_1_3
4410414
ns/iter (± 2386
)4709524
ns/iter (± 26073
)0.94
css/lexer/foundation_6_7_4
3708532
ns/iter (± 4149
)3766320
ns/iter (± 17058
)0.98
css/lexer/tailwind_3_1_1
706624
ns/iter (± 810
)716223
ns/iter (± 555
)0.99
css/parser/bootstrap_5_1_3
20019083
ns/iter (± 72422
)19161202
ns/iter (± 87502
)1.04
css/parser/foundation_6_7_4
15937981
ns/iter (± 34904
)15450588
ns/iter (± 86562
)1.03
css/parser/tailwind_3_1_1
3022753
ns/iter (± 5340
)2966187
ns/iter (± 23081
)1.02
es/codegen/colors
737912
ns/iter (± 402335
)737169
ns/iter (± 402992
)1.00
es/codegen/large
2889478
ns/iter (± 1522600
)2894447
ns/iter (± 1523841
)1.00
es/codegen/with-parser/colors
45160
ns/iter (± 638
)45514
ns/iter (± 528
)0.99
es/codegen/with-parser/large
487487
ns/iter (± 1144
)491660
ns/iter (± 1284
)0.99
es/minify/libraries/antd
1140125837
ns/iter (± 12718858
)1273694521
ns/iter (± 68278771
)0.90
es/minify/libraries/d3
237725228
ns/iter (± 3060643
)238517920
ns/iter (± 5044262
)1.00
es/minify/libraries/echarts
928401798
ns/iter (± 11631674
)1014988826
ns/iter (± 75786347
)0.91
es/minify/libraries/jquery
72673923
ns/iter (± 199382
)74857774
ns/iter (± 2302550
)0.97
es/minify/libraries/lodash
86321195
ns/iter (± 142767
)86746101
ns/iter (± 1131315
)1.00
es/minify/libraries/moment
43087533
ns/iter (± 116275
)46704188
ns/iter (± 1146703
)0.92
es/minify/libraries/react
15896057
ns/iter (± 34660
)18035918
ns/iter (± 585807
)0.88
es/minify/libraries/terser
184754155
ns/iter (± 548038
)198946639
ns/iter (± 5819214
)0.93
es/minify/libraries/three
320220185
ns/iter (± 6199091
)341828614
ns/iter (± 4157073
)0.94
es/minify/libraries/typescript
2237400026
ns/iter (± 19539913
)2317421684
ns/iter (± 40680091
)0.97
es/minify/libraries/victory
471123967
ns/iter (± 4354759
)573057485
ns/iter (± 31213335
)0.82
es/minify/libraries/vue
105340634
ns/iter (± 401716
)107560908
ns/iter (± 1510942
)0.98
es/visitor/compare/clone
1948451
ns/iter (± 2588
)1961398
ns/iter (± 8217
)0.99
es/visitor/compare/visit_mut_span
2253464
ns/iter (± 4223
)2296470
ns/iter (± 3950
)0.98
es/visitor/compare/visit_mut_span_panic
2315642
ns/iter (± 5642
)2371457
ns/iter (± 11007
)0.98
es/visitor/compare/fold_span
3367539
ns/iter (± 6957
)3389383
ns/iter (± 7015
)0.99
es/visitor/compare/fold_span_panic
3453547
ns/iter (± 9784
)3493627
ns/iter (± 12053
)0.99
es/lexer/colors
12960
ns/iter (± 16
)13411
ns/iter (± 82
)0.97
es/lexer/angular
6073178
ns/iter (± 10394
)6165325
ns/iter (± 2953
)0.99
es/lexer/backbone
785809
ns/iter (± 943
)816368
ns/iter (± 347
)0.96
es/lexer/jquery
4483385
ns/iter (± 15008
)4610037
ns/iter (± 2597
)0.97
es/lexer/jquery mobile
6914745
ns/iter (± 9224
)7003909
ns/iter (± 4435
)0.99
es/lexer/mootools
3551057
ns/iter (± 9097
)3607761
ns/iter (± 5288
)0.98
es/lexer/underscore
659091
ns/iter (± 768
)680324
ns/iter (± 336
)0.97
es/lexer/three
21479021
ns/iter (± 45740
)22033407
ns/iter (± 109589
)0.97
es/lexer/yui
3815890
ns/iter (± 3249
)3950373
ns/iter (± 11051
)0.97
es/parser/colors
27332
ns/iter (± 128
)27258
ns/iter (± 90
)1.00
es/parser/angular
13563330
ns/iter (± 48398
)13741807
ns/iter (± 209232
)0.99
es/parser/backbone
1982290
ns/iter (± 7433
)1977409
ns/iter (± 10736
)1.00
es/parser/jquery
10827768
ns/iter (± 42252
)10839911
ns/iter (± 86341
)1.00
es/parser/jquery mobile
16565811
ns/iter (± 77125
)17110068
ns/iter (± 225306
)0.97
es/parser/mootools
8315447
ns/iter (± 20682
)8307581
ns/iter (± 37905
)1.00
es/parser/underscore
1707572
ns/iter (± 15224
)1700285
ns/iter (± 7669
)1.00
es/parser/three
46557896
ns/iter (± 569712
)47880550
ns/iter (± 249273
)0.97
es/parser/yui
8270448
ns/iter (± 30599
)8274106
ns/iter (± 40185
)1.00
es/preset-env/usage/builtin_type
135415
ns/iter (± 32342
)133962
ns/iter (± 31969
)1.01
es/preset-env/usage/property
16393
ns/iter (± 66
)16248
ns/iter (± 55
)1.01
es/resolver/typescript
88477435
ns/iter (± 969201
)93420373
ns/iter (± 1675820
)0.95
es/fixer/typescript
64196123
ns/iter (± 646912
)69017951
ns/iter (± 1133855
)0.93
es/hygiene/typescript
130551605
ns/iter (± 2046976
)137091772
ns/iter (± 4596867
)0.95
es/resolver_with_hygiene/typescript
240201574
ns/iter (± 1393391
)248209759
ns/iter (± 4245481
)0.97
es/visitor/base-perf/module_clone
59044
ns/iter (± 305
)59469
ns/iter (± 225
)0.99
es/visitor/base-perf/fold_empty
62826
ns/iter (± 258
)63593
ns/iter (± 248
)0.99
es/visitor/base-perf/fold_noop_impl_all
63275
ns/iter (± 324
)63623
ns/iter (± 251
)0.99
es/visitor/base-perf/fold_noop_impl_vec
63808
ns/iter (± 259
)63053
ns/iter (± 200
)1.01
es/visitor/base-perf/boxing_boxed_clone
56
ns/iter (± 0
)56
ns/iter (± 0
)1
es/visitor/base-perf/boxing_unboxed_clone
41
ns/iter (± 0
)40
ns/iter (± 0
)1.02
es/visitor/base-perf/boxing_boxed
108
ns/iter (± 1
)108
ns/iter (± 0
)1
es/visitor/base-perf/boxing_unboxed
79
ns/iter (± 0
)79
ns/iter (± 0
)1
es/visitor/base-perf/visit_empty
0
ns/iter (± 0
)0
ns/iter (± 0
)NaN
es/visitor/base-perf/visit_contains_this
2635
ns/iter (± 24
)2621
ns/iter (± 10
)1.01
es/base/parallel/resolver/typescript
3806958650
ns/iter (± 218855773
)4373877120
ns/iter (± 252053697
)0.87
es/base/parallel/hygiene/typescript
1447320595
ns/iter (± 11888967
)1470857861
ns/iter (± 49768710
)0.98
misc/visitors/time-complexity/time 5
120
ns/iter (± 5
)132
ns/iter (± 1
)0.91
misc/visitors/time-complexity/time 10
392
ns/iter (± 13
)385
ns/iter (± 15
)1.02
misc/visitors/time-complexity/time 15
703
ns/iter (± 18
)688
ns/iter (± 5
)1.02
misc/visitors/time-complexity/time 20
1069
ns/iter (± 15
)1172
ns/iter (± 1
)0.91
misc/visitors/time-complexity/time 40
3604
ns/iter (± 20
)3513
ns/iter (± 19
)1.03
misc/visitors/time-complexity/time 60
7459
ns/iter (± 80
)7303
ns/iter (± 11
)1.02
es/full-target/es2016
229549
ns/iter (± 836
)230862
ns/iter (± 1270
)0.99
es/full-target/es2017
216684
ns/iter (± 464
)218069
ns/iter (± 712
)0.99
es/full-target/es2018
204919
ns/iter (± 513
)206036
ns/iter (± 654
)0.99
es2020_nullish_coalescing
69810
ns/iter (± 492
)70980
ns/iter (± 521
)0.98
es2020_optional_chaining
80504
ns/iter (± 273
)81476
ns/iter (± 302
)0.99
es2022_class_properties
113593
ns/iter (± 345
)114214
ns/iter (± 446
)0.99
es2018_object_rest_spread
74700
ns/iter (± 240
)74219
ns/iter (± 321
)1.01
es2019_optional_catch_binding
64325
ns/iter (± 200
)65083
ns/iter (± 146
)0.99
es2017_async_to_generator
63700
ns/iter (± 328
)64173
ns/iter (± 193
)0.99
es2016_exponentiation
67898
ns/iter (± 158
)68816
ns/iter (± 167
)0.99
es2015_arrow
70922
ns/iter (± 242
)72524
ns/iter (± 211
)0.98
es2015_block_scoped_fn
68550
ns/iter (± 189
)68715
ns/iter (± 137
)1.00
es2015_block_scoping
123401
ns/iter (± 461
)124348
ns/iter (± 451
)0.99
This comment was automatically generated by workflow using github-action-benchmark.