-
Notifications
You must be signed in to change notification settings - Fork 350
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
Conversation
Inspired by comments on #2215
015856c
to
7f4c817
Compare
@@ -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]; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 😅
There was a problem hiding this 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)
@ntkme Can you take another look at this? |
Inspired by comments on #2215