Skip to content

Commit

Permalink
feat(plugin/runner): Supports specifying exact path for plugin (#2918)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj authored Nov 30, 2021
1 parent e6957ce commit 5999634
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/swc_plugin_runner/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ pub fn resolve(name: &str) -> Result<Arc<PathBuf>, Error> {
let cwd = current_dir().context("failed to get current directory")?;
let mut dir = Some(&*cwd);

// If given name is a resolvable local path, returns it directly.
// It should be a path to the plugin file to be loaded, per-platform path
// interop is caller's responsibility.
let local_path = PathBuf::from(name);
if local_path.is_file() {
return Ok(Arc::new(local_path));
}

let mut errors = vec![];

while let Some(base_dir) = dir {
Expand Down

2 comments on commit 5999634

@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: 5999634 Previous: e6957ce Ratio
base_tr_fixer 26702 ns/iter (± 2757) 27609 ns/iter (± 439) 0.97
base_tr_resolver_and_hygiene 154749 ns/iter (± 46179) 156498 ns/iter (± 28053) 0.99
codegen_es2015 61345 ns/iter (± 4187) 63742 ns/iter (± 469) 0.96
codegen_es2016 60865 ns/iter (± 6706) 63399 ns/iter (± 446) 0.96
codegen_es2017 60490 ns/iter (± 3409) 64331 ns/iter (± 568) 0.94
codegen_es2018 61169 ns/iter (± 12437) 63285 ns/iter (± 382) 0.97
codegen_es2019 61163 ns/iter (± 20475) 63745 ns/iter (± 380) 0.96
codegen_es2020 61244 ns/iter (± 5580) 63781 ns/iter (± 452) 0.96
codegen_es3 60525 ns/iter (± 39111) 63281 ns/iter (± 567) 0.96
codegen_es5 61013 ns/iter (± 3717) 63625 ns/iter (± 570) 0.96
full_es2015 214402791 ns/iter (± 9215456) 219281919 ns/iter (± 17643474) 0.98
full_es2016 174097573 ns/iter (± 17346312) 176536643 ns/iter (± 9442977) 0.99
full_es2017 182527000 ns/iter (± 21161244) 182546496 ns/iter (± 9528624) 1.00
full_es2018 187457528 ns/iter (± 22614587) 182512751 ns/iter (± 11006285) 1.03
full_es2019 185784731 ns/iter (± 14175546) 180749425 ns/iter (± 11100382) 1.03
full_es2020 186921276 ns/iter (± 17853824) 179637001 ns/iter (± 13952453) 1.04
full_es3 269191784 ns/iter (± 32837343) 252280233 ns/iter (± 19770227) 1.07
full_es5 245812397 ns/iter (± 18584542) 237433309 ns/iter (± 12311317) 1.04
parser 818357 ns/iter (± 23619) 834112 ns/iter (± 23819) 0.98
ser_ast_node 183 ns/iter (± 14) 188 ns/iter (± 9) 0.97
ser_serde 185 ns/iter (± 21) 188 ns/iter (± 1) 0.98
emit_colors 20916027 ns/iter (± 26660489) 5978233 ns/iter (± 8265712) 3.50
emit_large 109869455 ns/iter (± 168433163) 135613548 ns/iter (± 199783941) 0.81
base_clone 3167710 ns/iter (± 1377285) 2858808 ns/iter (± 51251) 1.11
fold_span 5749106 ns/iter (± 1505063) 4687152 ns/iter (± 72884) 1.23
fold_span_panic 5738928 ns/iter (± 1753796) 4892677 ns/iter (± 143582) 1.17
visit_mut_span 4251041 ns/iter (± 1438985) 3467698 ns/iter (± 87749) 1.23
visit_mut_span_panic 3981938 ns/iter (± 660091) 3531354 ns/iter (± 193211) 1.13
ast_clone 21147 ns/iter (± 2988) 21531 ns/iter (± 260) 0.98
ast_clone_to_stable 60450 ns/iter (± 19007) 62217 ns/iter (± 410) 0.97
ast_clone_to_stable_then_to_unstable 111686 ns/iter (± 13398) 115441 ns/iter (± 573) 0.97
json_deserialize 2323003 ns/iter (± 172490) 2376487 ns/iter (± 5691) 0.98
json_serialize 110753 ns/iter (± 20719) 114677 ns/iter (± 825) 0.97
boxing_boxed 150 ns/iter (± 8) 156 ns/iter (± 0) 0.96
boxing_boxed_clone 81 ns/iter (± 25) 84 ns/iter (± 0) 0.96
boxing_unboxed 132 ns/iter (± 44) 146 ns/iter (± 0) 0.90
boxing_unboxed_clone 84 ns/iter (± 0) 78 ns/iter (± 0) 1.08
time_10 380 ns/iter (± 2) 396 ns/iter (± 2) 0.96
time_15 790 ns/iter (± 4) 824 ns/iter (± 2) 0.96
time_20 1371 ns/iter (± 14) 1425 ns/iter (± 13) 0.96
time_40 5012 ns/iter (± 84) 5331 ns/iter (± 7) 0.94
time_5 120 ns/iter (± 1) 125 ns/iter (± 1) 0.96
time_60 10737 ns/iter (± 3624) 10602 ns/iter (± 39) 1.01

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 5999634 Previous: e6957ce Ratio
emit_colors 20916027 ns/iter (± 26660489) 5978233 ns/iter (± 8265712) 3.50

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

CC: @kdy1

Please sign in to comment.