File tree 2 files changed +19
-15
lines changed
2 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -696,17 +696,17 @@ impl Options {
696
696
// target.
697
697
init_plugin_module_cache_once ( true , & experimental. cache_root ) ;
698
698
699
+ let mut inner_cache = PLUGIN_MODULE_CACHE
700
+ . inner
701
+ . get ( )
702
+ . expect ( "Cache should be available" )
703
+ . lock ( ) ;
704
+
699
705
// Populate cache to the plugin modules if not loaded
700
706
for plugin_config in plugins. iter ( ) {
701
707
let plugin_name = & plugin_config. 0 ;
702
708
703
- if !PLUGIN_MODULE_CACHE
704
- . inner
705
- . get ( )
706
- . unwrap ( )
707
- . lock ( )
708
- . contains ( & plugin_name)
709
- {
709
+ if !inner_cache. contains ( & plugin_name) {
710
710
let resolved_path = plugin_resolver. resolve (
711
711
& FileName :: Real ( PathBuf :: from ( & plugin_name) ) ,
712
712
& plugin_name,
@@ -718,12 +718,8 @@ impl Options {
718
718
anyhow:: bail!( "Failed to resolve plugin path: {:?}" , resolved_path) ;
719
719
} ;
720
720
721
- let mut inner_cache = PLUGIN_MODULE_CACHE
722
- . inner
723
- . get ( )
724
- . expect ( "Cache should be available" )
725
- . lock ( ) ;
726
721
inner_cache. store_bytes_from_path ( & path, & plugin_name) ?;
722
+ tracing:: debug!( "Initialized WASM plugin {plugin_name}" ) ;
727
723
}
728
724
}
729
725
}
Original file line number Diff line number Diff line change @@ -116,9 +116,17 @@ impl PluginModuleCacheInner {
116
116
if let Some ( fs_cache_store) = & mut self . fs_cache_store {
117
117
let module_bytes_hash = Hash :: generate ( & raw_module_bytes) ;
118
118
let store = new_store ( ) ;
119
- let module = Module :: new ( & store, raw_module_bytes. clone ( ) )
120
- . context ( "Cannot compile plugin binary" ) ?;
121
- fs_cache_store. store ( module_bytes_hash, & module) ?;
119
+
120
+ let module =
121
+ if let Ok ( module) = unsafe { fs_cache_store. load ( & store, module_bytes_hash) } {
122
+ tracing:: debug!( "Build WASM from cache: {key}" ) ;
123
+ module
124
+ } else {
125
+ let module = Module :: new ( & store, raw_module_bytes. clone ( ) )
126
+ . context ( "Cannot compile plugin binary" ) ?;
127
+ fs_cache_store. store ( module_bytes_hash, & module) ?;
128
+ module
129
+ } ;
122
130
123
131
// Store hash to load from fs_cache_store later.
124
132
self . fs_cache_hash_store
You can’t perform that action at this time.
1 commit comments
github-actions[bot] commentedon Aug 4, 2023
Benchmark
es/full/bugs-1
295914
ns/iter (± 8434
)289721
ns/iter (± 5788
)1.02
es/full/minify/libraries/antd
1343013103
ns/iter (± 9171052
)1330597177
ns/iter (± 19310866
)1.01
es/full/minify/libraries/d3
280868615
ns/iter (± 4462783
)279155620
ns/iter (± 4386437
)1.01
es/full/minify/libraries/echarts
1079116256
ns/iter (± 11951375
)1071673101
ns/iter (± 8903824
)1.01
es/full/minify/libraries/jquery
85269434
ns/iter (± 260022
)84631731
ns/iter (± 187144
)1.01
es/full/minify/libraries/lodash
98954150
ns/iter (± 351279
)98498148
ns/iter (± 858282
)1.00
es/full/minify/libraries/moment
49959071
ns/iter (± 99283
)49746807
ns/iter (± 102802
)1.00
es/full/minify/libraries/react
18011389
ns/iter (± 35356
)17983782
ns/iter (± 94272
)1.00
es/full/minify/libraries/terser
220850711
ns/iter (± 979269
)220151251
ns/iter (± 1589090
)1.00
es/full/minify/libraries/three
390107365
ns/iter (± 3902790
)387707195
ns/iter (± 3441287
)1.01
es/full/minify/libraries/typescript
2666167376
ns/iter (± 9454880
)2686148189
ns/iter (± 9619554
)0.99
es/full/minify/libraries/victory
561880222
ns/iter (± 8582351
)567446094
ns/iter (± 5573805
)0.99
es/full/minify/libraries/vue
120267849
ns/iter (± 541279
)120313640
ns/iter (± 243653
)1.00
es/full/codegen/es3
35476
ns/iter (± 99
)34453
ns/iter (± 113
)1.03
es/full/codegen/es5
35484
ns/iter (± 73
)34529
ns/iter (± 90
)1.03
es/full/codegen/es2015
35387
ns/iter (± 115
)34543
ns/iter (± 143
)1.02
es/full/codegen/es2016
35596
ns/iter (± 71
)34527
ns/iter (± 152
)1.03
es/full/codegen/es2017
35538
ns/iter (± 147
)34391
ns/iter (± 289
)1.03
es/full/codegen/es2018
35566
ns/iter (± 107
)34366
ns/iter (± 97
)1.03
es/full/codegen/es2019
35519
ns/iter (± 219
)34440
ns/iter (± 44
)1.03
es/full/codegen/es2020
35501
ns/iter (± 93
)34505
ns/iter (± 149
)1.03
es/full/all/es3
172743214
ns/iter (± 1231695
)173295454
ns/iter (± 746579
)1.00
es/full/all/es5
164858712
ns/iter (± 1337508
)164852744
ns/iter (± 1006808
)1.00
es/full/all/es2015
124324434
ns/iter (± 896457
)125271527
ns/iter (± 666080
)0.99
es/full/all/es2016
123434125
ns/iter (± 387921
)123880595
ns/iter (± 669475
)1.00
es/full/all/es2017
122917546
ns/iter (± 714464
)122906297
ns/iter (± 522699
)1.00
es/full/all/es2018
120743653
ns/iter (± 661044
)121190424
ns/iter (± 624271
)1.00
es/full/all/es2019
119301080
ns/iter (± 737894
)120302874
ns/iter (± 599893
)0.99
es/full/all/es2020
115566620
ns/iter (± 639092
)116146478
ns/iter (± 822139
)1.00
es/full/parser
533227
ns/iter (± 5610
)538357
ns/iter (± 6247
)0.99
es/full/base/fixer
18659
ns/iter (± 136
)19163
ns/iter (± 85
)0.97
es/full/base/resolver_and_hygiene
81926
ns/iter (± 93
)81795
ns/iter (± 143
)1.00
serialization of serde
291
ns/iter (± 0
)291
ns/iter (± 0
)1
css/minify/libraries/bootstrap
28795234
ns/iter (± 75696
)29659192
ns/iter (± 119883
)0.97
css/visitor/compare/clone
1658944
ns/iter (± 3243
)1648637
ns/iter (± 1604
)1.01
css/visitor/compare/visit_mut_span
1784477
ns/iter (± 4373
)1787868
ns/iter (± 3471
)1.00
css/visitor/compare/visit_mut_span_panic
1858858
ns/iter (± 5680
)1834002
ns/iter (± 6212
)1.01
css/visitor/compare/fold_span
2609178
ns/iter (± 11360
)2614384
ns/iter (± 8743
)1.00
css/visitor/compare/fold_span_panic
2803620
ns/iter (± 12107
)2797668
ns/iter (± 12296
)1.00
css/lexer/bootstrap_5_1_3
4476079
ns/iter (± 1562
)4450942
ns/iter (± 3060
)1.01
css/lexer/foundation_6_7_4
3774179
ns/iter (± 2932
)3734364
ns/iter (± 1632
)1.01
css/lexer/tailwind_3_1_1
714509
ns/iter (± 310
)711432
ns/iter (± 363
)1.00
css/parser/bootstrap_5_1_3
19123151
ns/iter (± 33066
)19426689
ns/iter (± 26268
)0.98
css/parser/foundation_6_7_4
15223725
ns/iter (± 10994
)15563211
ns/iter (± 25236
)0.98
css/parser/tailwind_3_1_1
2948723
ns/iter (± 2167
)3029438
ns/iter (± 6155
)0.97
es/codegen/colors
732336
ns/iter (± 401087
)748911
ns/iter (± 401067
)0.98
es/codegen/large
3124554
ns/iter (± 1672423
)3141277
ns/iter (± 1678728
)0.99
es/codegen/with-parser/colors
44075
ns/iter (± 531
)43871
ns/iter (± 611
)1.00
es/codegen/with-parser/large
483034
ns/iter (± 893
)482679
ns/iter (± 1292
)1.00
es/minify/libraries/antd
1162761527
ns/iter (± 11970820
)1180731700
ns/iter (± 22390670
)0.98
es/minify/libraries/d3
241981291
ns/iter (± 1316626
)245265104
ns/iter (± 2459516
)0.99
es/minify/libraries/echarts
928507728
ns/iter (± 12391128
)942673340
ns/iter (± 10453269
)0.98
es/minify/libraries/jquery
74402589
ns/iter (± 451664
)74544357
ns/iter (± 235493
)1.00
es/minify/libraries/lodash
88812779
ns/iter (± 274180
)89106889
ns/iter (± 177982
)1.00
es/minify/libraries/moment
43865647
ns/iter (± 68410
)44042717
ns/iter (± 53770
)1.00
es/minify/libraries/react
16097717
ns/iter (± 55855
)16131132
ns/iter (± 112201
)1.00
es/minify/libraries/terser
189550086
ns/iter (± 1059551
)189829131
ns/iter (± 700429
)1.00
es/minify/libraries/three
326866482
ns/iter (± 2753950
)328655050
ns/iter (± 2857462
)0.99
es/minify/libraries/typescript
2308666259
ns/iter (± 12832078
)2313867667
ns/iter (± 6266944
)1.00
es/minify/libraries/victory
486155814
ns/iter (± 6372371
)489437813
ns/iter (± 6639919
)0.99
es/minify/libraries/vue
108105368
ns/iter (± 410438
)108510488
ns/iter (± 346204
)1.00
es/visitor/compare/clone
1936366
ns/iter (± 7972
)1943635
ns/iter (± 4999
)1.00
es/visitor/compare/visit_mut_span
2278880
ns/iter (± 6056
)2286648
ns/iter (± 4905
)1.00
es/visitor/compare/visit_mut_span_panic
2319314
ns/iter (± 4206
)2324160
ns/iter (± 3462
)1.00
es/visitor/compare/fold_span
3326141
ns/iter (± 34974
)3353660
ns/iter (± 51255
)0.99
es/visitor/compare/fold_span_panic
3480809
ns/iter (± 4043
)3495118
ns/iter (± 5449
)1.00
es/lexer/colors
12383
ns/iter (± 43
)12447
ns/iter (± 24
)0.99
es/lexer/angular
5978412
ns/iter (± 5214
)6095764
ns/iter (± 2301
)0.98
es/lexer/backbone
781189
ns/iter (± 296
)795441
ns/iter (± 1636
)0.98
es/lexer/jquery
4383192
ns/iter (± 2321
)4482180
ns/iter (± 9671
)0.98
es/lexer/jquery mobile
6715428
ns/iter (± 8313
)6932778
ns/iter (± 12092
)0.97
es/lexer/mootools
3476558
ns/iter (± 2887
)3543093
ns/iter (± 2701
)0.98
es/lexer/underscore
653043
ns/iter (± 440
)663523
ns/iter (± 696
)0.98
es/lexer/three
20609943
ns/iter (± 9886
)21021109
ns/iter (± 14036
)0.98
es/lexer/yui
3760274
ns/iter (± 960
)3862609
ns/iter (± 2319
)0.97
es/parser/colors
26301
ns/iter (± 43
)26548
ns/iter (± 72
)0.99
es/parser/angular
13398972
ns/iter (± 39035
)13576108
ns/iter (± 87513
)0.99
es/parser/backbone
1997031
ns/iter (± 8635
)2007641
ns/iter (± 8587
)0.99
es/parser/jquery
10807802
ns/iter (± 40233
)10894439
ns/iter (± 39409
)0.99
es/parser/jquery mobile
16585402
ns/iter (± 66178
)16688693
ns/iter (± 128122
)0.99
es/parser/mootools
8348554
ns/iter (± 19304
)8393445
ns/iter (± 17864
)0.99
es/parser/underscore
1715966
ns/iter (± 8968
)1722283
ns/iter (± 9980
)1.00
es/parser/three
46689038
ns/iter (± 278711
)47082030
ns/iter (± 551674
)0.99
es/parser/yui
8230237
ns/iter (± 25414
)8279191
ns/iter (± 25239
)0.99
es/preset-env/usage/builtin_type
140491
ns/iter (± 32990
)138561
ns/iter (± 32363
)1.01
es/preset-env/usage/property
16689
ns/iter (± 44
)17182
ns/iter (± 35
)0.97
es/resolver/typescript
88147719
ns/iter (± 1083920
)88860033
ns/iter (± 1299087
)0.99
es/fixer/typescript
63793701
ns/iter (± 687519
)63882719
ns/iter (± 353373
)1.00
es/hygiene/typescript
131005544
ns/iter (± 696052
)132189379
ns/iter (± 1021623
)0.99
es/resolver_with_hygiene/typescript
240772424
ns/iter (± 1680146
)243402536
ns/iter (± 1379542
)0.99
es/visitor/base-perf/module_clone
60030
ns/iter (± 275
)60814
ns/iter (± 636
)0.99
es/visitor/base-perf/fold_empty
64177
ns/iter (± 370
)63220
ns/iter (± 178
)1.02
es/visitor/base-perf/fold_noop_impl_all
63628
ns/iter (± 537
)63216
ns/iter (± 541
)1.01
es/visitor/base-perf/fold_noop_impl_vec
64263
ns/iter (± 266
)63792
ns/iter (± 601
)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
110
ns/iter (± 0
)106
ns/iter (± 0
)1.04
es/visitor/base-perf/boxing_unboxed
79
ns/iter (± 0
)75
ns/iter (± 0
)1.05
es/visitor/base-perf/visit_empty
0
ns/iter (± 0
)0
ns/iter (± 0
)NaN
es/visitor/base-perf/visit_contains_this
2574
ns/iter (± 22
)2520
ns/iter (± 11
)1.02
es/base/parallel/resolver/typescript
3973775216
ns/iter (± 325370232
)4501817001
ns/iter (± 215969860
)0.88
es/base/parallel/hygiene/typescript
1487849691
ns/iter (± 3491625
)1470088164
ns/iter (± 12187101
)1.01
misc/visitors/time-complexity/time 5
137
ns/iter (± 1
)145
ns/iter (± 3
)0.94
misc/visitors/time-complexity/time 10
402
ns/iter (± 5
)380
ns/iter (± 3
)1.06
misc/visitors/time-complexity/time 15
511
ns/iter (± 72
)678
ns/iter (± 32
)0.75
misc/visitors/time-complexity/time 20
908
ns/iter (± 2
)1045
ns/iter (± 12
)0.87
misc/visitors/time-complexity/time 40
3497
ns/iter (± 39
)3565
ns/iter (± 3
)0.98
misc/visitors/time-complexity/time 60
7241
ns/iter (± 15
)7421
ns/iter (± 648
)0.98
es/full-target/es2016
237953
ns/iter (± 1510
)238150
ns/iter (± 509
)1.00
es/full-target/es2017
224845
ns/iter (± 2836
)227133
ns/iter (± 623
)0.99
es/full-target/es2018
214963
ns/iter (± 547
)214227
ns/iter (± 502
)1.00
es2020_nullish_coalescing
68436
ns/iter (± 468
)68845
ns/iter (± 372
)0.99
es2020_optional_chaining
79154
ns/iter (± 242
)78678
ns/iter (± 312
)1.01
es2022_class_properties
118447
ns/iter (± 306
)117696
ns/iter (± 324
)1.01
es2018_object_rest_spread
73513
ns/iter (± 175
)72766
ns/iter (± 213
)1.01
es2019_optional_catch_binding
62806
ns/iter (± 283
)62785
ns/iter (± 186
)1.00
es2017_async_to_generator
61670
ns/iter (± 247
)61557
ns/iter (± 292
)1.00
es2016_exponentiation
66485
ns/iter (± 228
)66583
ns/iter (± 300
)1.00
es2015_arrow
69179
ns/iter (± 158
)69277
ns/iter (± 177
)1.00
es2015_block_scoped_fn
67018
ns/iter (± 150
)67452
ns/iter (± 277
)0.99
es2015_block_scoping
121218
ns/iter (± 630
)121489
ns/iter (± 600
)1.00
This comment was automatically generated by workflow using github-action-benchmark.