Skip to content

Commit

Permalink
feat(plugin/runner): Improve cache path (#7188)
Browse files Browse the repository at this point in the history
**Description:**

This PR is minor improvement, non breaking changes to cache path for the plugin. In short, it tries to combine rustc version if available to expand. `option_env!` supposed to embed build time rustc version. It'd be ideal if we could match between plugin's as well, but I doubt if we could before actually load plugin.
  • Loading branch information
kwonoj authored Apr 2, 2023
1 parent fa15334 commit 976667f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/swc_plugin_runner/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ fn create_filesystem_cache(filesystem_cache_root: &Option<String>) -> Option<Fil

if let Some(root_path) = &mut root_path {
root_path.push("plugins");
root_path.push(MODULE_SERIALIZATION_VERSION);
root_path.push(format!(
"{}_{}",
MODULE_SERIALIZATION_VERSION,
option_env!("CARGO_PKG_RUST_VERSION").unwrap_or("default")
));

return FileSystemCache::new(&root_path).ok();
}
Expand Down

1 comment on commit 976667f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 976667f Previous: df7b4e7 Ratio
es/full/bugs-1 298054 ns/iter (± 10323) 308518 ns/iter (± 5262) 0.97
es/full/minify/libraries/antd 1595221496 ns/iter (± 17620009) 1618657672 ns/iter (± 40418617) 0.99
es/full/minify/libraries/d3 291116201 ns/iter (± 7580105) 298840073 ns/iter (± 7936825) 0.97
es/full/minify/libraries/echarts 1191995222 ns/iter (± 16608863) 1226898101 ns/iter (± 17894600) 0.97
es/full/minify/libraries/jquery 89463557 ns/iter (± 1226184) 90277760 ns/iter (± 521093) 0.99
es/full/minify/libraries/lodash 105452875 ns/iter (± 13076392) 104815922 ns/iter (± 912919) 1.01
es/full/minify/libraries/moment 51503098 ns/iter (± 420571) 52346299 ns/iter (± 423367) 0.98
es/full/minify/libraries/react 18777514 ns/iter (± 119250) 19138856 ns/iter (± 227146) 0.98
es/full/minify/libraries/terser 241597557 ns/iter (± 2308772) 248247521 ns/iter (± 3636671) 0.97
es/full/minify/libraries/three 429297842 ns/iter (± 7141073) 434551669 ns/iter (± 3377169) 0.99
es/full/minify/libraries/typescript 3024264929 ns/iter (± 22596243) 3085532926 ns/iter (± 60312318) 0.98
es/full/minify/libraries/victory 675830795 ns/iter (± 37814770) 704530067 ns/iter (± 11596938) 0.96
es/full/minify/libraries/vue 132532429 ns/iter (± 3605162) 132311610 ns/iter (± 1241176) 1.00
es/full/codegen/es3 28820 ns/iter (± 74) 28789 ns/iter (± 57) 1.00
es/full/codegen/es5 28972 ns/iter (± 81) 28937 ns/iter (± 39) 1.00
es/full/codegen/es2015 28931 ns/iter (± 77) 28896 ns/iter (± 47) 1.00
es/full/codegen/es2016 28970 ns/iter (± 616) 28905 ns/iter (± 38) 1.00
es/full/codegen/es2017 28930 ns/iter (± 65) 28790 ns/iter (± 69) 1.00
es/full/codegen/es2018 28938 ns/iter (± 62) 28925 ns/iter (± 62) 1.00
es/full/codegen/es2019 28969 ns/iter (± 185) 28842 ns/iter (± 80) 1.00
es/full/codegen/es2020 28947 ns/iter (± 57) 28844 ns/iter (± 49) 1.00
es/full/all/es3 180262264 ns/iter (± 2044324) 180580662 ns/iter (± 2351385) 1.00
es/full/all/es5 170810683 ns/iter (± 2266063) 170547068 ns/iter (± 2784161) 1.00
es/full/all/es2015 130613481 ns/iter (± 1705982) 134320395 ns/iter (± 2096706) 0.97
es/full/all/es2016 130423760 ns/iter (± 1072599) 130730819 ns/iter (± 5604847) 1.00
es/full/all/es2017 127925073 ns/iter (± 1828929) 132278857 ns/iter (± 1663664) 0.97
es/full/all/es2018 122731709 ns/iter (± 1080514) 125214455 ns/iter (± 1847700) 0.98
es/full/all/es2019 121281320 ns/iter (± 1051571) 124151561 ns/iter (± 2126899) 0.98
es/full/all/es2020 116688934 ns/iter (± 987426) 116930865 ns/iter (± 675254) 1.00
es/full/parser 515057 ns/iter (± 7206) 517571 ns/iter (± 8678) 1.00
es/full/base/fixer 22888 ns/iter (± 27) 22634 ns/iter (± 54) 1.01
es/full/base/resolver_and_hygiene 83948 ns/iter (± 134) 83764 ns/iter (± 171) 1.00
serialization of serde 127 ns/iter (± 0) 126 ns/iter (± 0) 1.01
css/minify/libraries/bootstrap 27621105 ns/iter (± 160589) 27472937 ns/iter (± 118756) 1.01
css/visitor/compare/clone 2124865 ns/iter (± 7104) 2149341 ns/iter (± 7396) 0.99
css/visitor/compare/visit_mut_span 2305118 ns/iter (± 5290) 2313866 ns/iter (± 6592) 1.00
css/visitor/compare/visit_mut_span_panic 2340496 ns/iter (± 4765) 2377476 ns/iter (± 48690) 0.98
css/visitor/compare/fold_span 3104971 ns/iter (± 11311) 3088903 ns/iter (± 12000) 1.01
css/visitor/compare/fold_span_panic 3225749 ns/iter (± 17557) 3286742 ns/iter (± 15002) 0.98
css/lexer/bootstrap_5_1_3 5131904 ns/iter (± 13023) 5139974 ns/iter (± 28215) 1.00
css/lexer/foundation_6_7_4 4337864 ns/iter (± 4165) 4329641 ns/iter (± 2664) 1.00
css/lexer/tailwind_3_1_1 822611 ns/iter (± 888) 822982 ns/iter (± 1023) 1.00
css/parser/bootstrap_5_1_3 21117854 ns/iter (± 136273) 20912642 ns/iter (± 55083) 1.01
css/parser/foundation_6_7_4 16839177 ns/iter (± 38126) 16804827 ns/iter (± 208160) 1.00
css/parser/tailwind_3_1_1 3241642 ns/iter (± 4051) 3221675 ns/iter (± 3038) 1.01
es/codegen/colors 327847 ns/iter (± 185563) 318092 ns/iter (± 180851) 1.03
es/codegen/large 1246404 ns/iter (± 643828) 1278025 ns/iter (± 638888) 0.98
es/codegen/with-parser/colors 47109 ns/iter (± 468) 46839 ns/iter (± 336) 1.01
es/codegen/with-parser/large 518557 ns/iter (± 11521) 508458 ns/iter (± 1469) 1.02
es/minify/libraries/antd 1376435132 ns/iter (± 29787805) 1428047242 ns/iter (± 48440549) 0.96
es/minify/libraries/d3 250579287 ns/iter (± 4688700) 253226985 ns/iter (± 4129214) 0.99
es/minify/libraries/echarts 1043766651 ns/iter (± 20489258) 1076650813 ns/iter (± 15075787) 0.97
es/minify/libraries/jquery 78385309 ns/iter (± 529122) 78774305 ns/iter (± 510272) 1.00
es/minify/libraries/lodash 93340369 ns/iter (± 1385866) 94091429 ns/iter (± 515591) 0.99
es/minify/libraries/moment 45279645 ns/iter (± 277228) 45428124 ns/iter (± 420796) 1.00
es/minify/libraries/react 16762444 ns/iter (± 121301) 17039051 ns/iter (± 189833) 0.98
es/minify/libraries/terser 203124503 ns/iter (± 1054133) 208628727 ns/iter (± 2663152) 0.97
es/minify/libraries/three 350784224 ns/iter (± 4993770) 359759426 ns/iter (± 3565709) 0.98
es/minify/libraries/typescript 2567842448 ns/iter (± 14397880) 2616041810 ns/iter (± 15188129) 0.98
es/minify/libraries/victory 539959178 ns/iter (± 8700728) 570016089 ns/iter (± 11792975) 0.95
es/minify/libraries/vue 114942402 ns/iter (± 1202365) 115094218 ns/iter (± 657153) 1.00
es/visitor/compare/clone 2318843 ns/iter (± 11051) 2320256 ns/iter (± 7677) 1.00
es/visitor/compare/visit_mut_span 2685863 ns/iter (± 5645) 2704710 ns/iter (± 5796) 0.99
es/visitor/compare/visit_mut_span_panic 2723606 ns/iter (± 6092) 2728456 ns/iter (± 2172) 1.00
es/visitor/compare/fold_span 3790974 ns/iter (± 17814) 3788494 ns/iter (± 13854) 1.00
es/visitor/compare/fold_span_panic 3906969 ns/iter (± 7713) 3931931 ns/iter (± 6808) 0.99
es/lexer/colors 13093 ns/iter (± 16) 13115 ns/iter (± 13) 1.00
es/lexer/angular 6410982 ns/iter (± 22651) 6398592 ns/iter (± 7314) 1.00
es/lexer/backbone 771368 ns/iter (± 1033) 766827 ns/iter (± 652) 1.01
es/lexer/jquery 4309836 ns/iter (± 4172) 4311618 ns/iter (± 1820) 1.00
es/lexer/jquery mobile 6751319 ns/iter (± 8616) 6749973 ns/iter (± 7837) 1.00
es/lexer/mootools 3413553 ns/iter (± 1852) 3415719 ns/iter (± 2022) 1.00
es/lexer/underscore 638557 ns/iter (± 1088) 634231 ns/iter (± 231) 1.01
es/lexer/three 20539928 ns/iter (± 36511) 20524357 ns/iter (± 19427) 1.00
es/lexer/yui 3842670 ns/iter (± 3790) 3837992 ns/iter (± 1346) 1.00
es/parser/colors 28493 ns/iter (± 47) 28529 ns/iter (± 99) 1.00
es/parser/angular 14883859 ns/iter (± 117139) 14986657 ns/iter (± 176217) 0.99
es/parser/backbone 2168091 ns/iter (± 17447) 2164748 ns/iter (± 20346) 1.00
es/parser/jquery 11651413 ns/iter (± 88081) 11686919 ns/iter (± 133893) 1.00
es/parser/jquery mobile 18132936 ns/iter (± 133153) 18270061 ns/iter (± 220408) 0.99
es/parser/mootools 8883718 ns/iter (± 24381) 8857632 ns/iter (± 20665) 1.00
es/parser/underscore 1830362 ns/iter (± 12136) 1814800 ns/iter (± 14864) 1.01
es/parser/three 52874614 ns/iter (± 1019183) 53443028 ns/iter (± 845450) 0.99
es/parser/yui 8992259 ns/iter (± 44476) 8974021 ns/iter (± 59228) 1.00
es/preset-env/usage/builtin_type 143628 ns/iter (± 34222) 144111 ns/iter (± 34326) 1.00
es/preset-env/usage/property 21146 ns/iter (± 99) 21214 ns/iter (± 65) 1.00
es/resolver/typescript 119533842 ns/iter (± 3332860) 119434908 ns/iter (± 2414700) 1.00
es/fixer/typescript 85264274 ns/iter (± 701438) 86814490 ns/iter (± 610088) 0.98
es/hygiene/typescript 182772962 ns/iter (± 3867393) 190336323 ns/iter (± 2892377) 0.96
es/resolver_with_hygiene/typescript 320864731 ns/iter (± 2613472) 321832300 ns/iter (± 2687353) 1.00
es/visitor/base-perf/module_clone 80608 ns/iter (± 243) 80983 ns/iter (± 600) 1.00
es/visitor/base-perf/fold_empty 90569 ns/iter (± 341) 90903 ns/iter (± 250) 1.00
es/visitor/base-perf/fold_noop_impl_all 90905 ns/iter (± 431) 91274 ns/iter (± 388) 1.00
es/visitor/base-perf/fold_noop_impl_vec 91353 ns/iter (± 315) 91441 ns/iter (± 445) 1.00
es/visitor/base-perf/boxing_boxed_clone 56 ns/iter (± 0) 56 ns/iter (± 0) 1
es/visitor/base-perf/boxing_unboxed_clone 42 ns/iter (± 0) 42 ns/iter (± 0) 1
es/visitor/base-perf/boxing_boxed 102 ns/iter (± 0) 104 ns/iter (± 0) 0.98
es/visitor/base-perf/boxing_unboxed 78 ns/iter (± 0) 78 ns/iter (± 0) 1
es/visitor/base-perf/visit_contains_this 3513 ns/iter (± 85) 3650 ns/iter (± 64) 0.96
es/base/parallel/resolver/typescript 6144535654 ns/iter (± 459052033) 6457017670 ns/iter (± 515271659) 0.95
es/base/parallel/hygiene/typescript 2192710717 ns/iter (± 19045147) 2176684035 ns/iter (± 16616356) 1.01
misc/visitors/time-complexity/time 5 104 ns/iter (± 0) 104 ns/iter (± 0) 1
misc/visitors/time-complexity/time 10 326 ns/iter (± 2) 326 ns/iter (± 0) 1
misc/visitors/time-complexity/time 15 661 ns/iter (± 0) 661 ns/iter (± 6) 1
misc/visitors/time-complexity/time 20 1253 ns/iter (± 12) 1218 ns/iter (± 3) 1.03
misc/visitors/time-complexity/time 40 6199 ns/iter (± 7) 6216 ns/iter (± 27) 1.00
misc/visitors/time-complexity/time 60 15575 ns/iter (± 34) 15585 ns/iter (± 19) 1.00
es/full-target/es2016 253012 ns/iter (± 478) 252365 ns/iter (± 1700) 1.00
es/full-target/es2017 246955 ns/iter (± 437) 246342 ns/iter (± 364) 1.00
es/full-target/es2018 235430 ns/iter (± 255) 234916 ns/iter (± 374) 1.00
es2020_nullish_coalescing 93167 ns/iter (± 392) 92634 ns/iter (± 287) 1.01
es2020_optional_chaining 123787 ns/iter (± 194) 124332 ns/iter (± 107) 1.00
es2022_class_properties 148662 ns/iter (± 388) 149017 ns/iter (± 185) 1.00
es2018_object_rest_spread 96249 ns/iter (± 165) 96319 ns/iter (± 225) 1.00
es2019_optional_catch_binding 85251 ns/iter (± 263) 85295 ns/iter (± 285) 1.00
es2017_async_to_generator 86109 ns/iter (± 204) 85939 ns/iter (± 305) 1.00
es2016_exponentiation 90371 ns/iter (± 235) 90044 ns/iter (± 198) 1.00
es2015_arrow 93896 ns/iter (± 217) 93812 ns/iter (± 341) 1.00
es2015_block_scoped_fn 91800 ns/iter (± 208) 91810 ns/iter (± 202) 1.00
es2015_block_scoping 169353 ns/iter (± 175) 169290 ns/iter (± 405) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.