fix: move join/dirname caches to Resolver instance to prevent memory leak#507
fix: move join/dirname caches to Resolver instance to prevent memory leak#507alexander-akait merged 8 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 3b0e639 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #507 +/- ##
==========================================
+ Coverage 93.42% 93.50% +0.07%
==========================================
Files 50 50
Lines 2525 2555 +30
Branches 773 779 +6
==========================================
+ Hits 2359 2389 +30
Misses 137 137
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
724f707 to
fd07044
Compare
lib/Resolver.js
Outdated
| constructor(fileSystem, options) { | ||
| this.fileSystem = fileSystem; | ||
| this.options = options; | ||
| if (options.unsafeCache) { |
There was a problem hiding this comment.
@xiaoxiaojx I think we will have a perf regression here, before we always cache path operations, now we are doing it only when unsafeCache is enabled
There was a problem hiding this comment.
Yeah, here I’m thinking of leveraging the unsafeCache option as much as possible. I’ll run the new benchmark just added and see how it performs.
fd07044 to
115db10
Compare
Merging this PR will improve performance by 31.23%
Performance Changes
Comparing |
b6719b2 to
ca39d4e
Compare

Summary
fixes #414
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Existing
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing
Use of AI
Partial