Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a per-importer cache for loads that aren't cacheable en masse #2219

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Apr 12, 2024

Inspired by comments on #2215

@nex3 nex3 requested a review from Goodwine April 12, 2024 01:18
@nex3
Copy link
Contributor Author

nex3 commented Apr 12, 2024

@ntkme

@@ -181,17 +168,34 @@ final class AsyncImportCache {
// `canonicalize()` calls we've attempted are cacheable. Only if they are do
// we store the result in the cache.
var cacheable = true;
for (var importer in _importers) {
for (var i = 0; i < _importers.length; i++) {
var importer = _importers[i];
Copy link
Member

Choose a reason for hiding this comment

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

There should be a check around here for the presence of _perImporterCanonicalizeCache, no?

Otherwise _canonicalize gets executed for all the importers previous to the one that returned a non-null and non-cacheable result

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, actually checking the cache is an important part of a caching scheme 😅

Copy link
Member

@Goodwine Goodwine left a comment

Choose a reason for hiding this comment

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

(oops meant to click request changes)

@nex3 nex3 requested review from Goodwine and ntkme April 12, 2024 21:46
@nex3
Copy link
Contributor Author

nex3 commented Apr 17, 2024

@ntkme Can you take another look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants