swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.26k stars 1.23k forks source link

perf(es): Cache `current_dir()` system calls #9683

Closed kdy1 closed 3 weeks ago

kdy1 commented 3 weeks ago

Description:

Cache current_dir() system calls. Those are needless because we already cache current_dir in some places so it will break if the user changes cwd anyway.

Related issue:

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 8f0a7b0306ea59a78a11221611957649aa33c5d1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/kdy1/swc/new/io-op?filename=.changeset/quick-jars-poke.md&value=---%0A%22%40fake-scope%2Ffake-pkg%22%3A%20patch%0A---%0A%0Aperf(es)%3A%20Cache%20%60current_dir()%60%20system%20calls%0A)

codspeed-hq[bot] commented 3 weeks ago

CodSpeed Performance Report

Merging #9683 will degrade performances by 6.97%

Comparing kdy1:io-op (8f0a7b0) with main (581aafb)

Summary

❌ 1 regressions ✅ 193 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main kdy1:io-op Change
es/full/bugs-1 525.6 µs 564.9 µs -6.97%