-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
OOM in ImageElements gatherer #11289
Comments
I did some exploring on this issue, but I couldn't find (& don't think I have) access to LR so this is coming from observing what happens on my local machine: I don't know if the slow down from In the
to
since we don't currently check css background-images in Additionally, I agree with @patrickhulce about
or other workarounds that can reduce the total calls to I noticed that a large amount of the ImageElements in As for the OOM issue, I had some leads I could think of:
that disappear after adding
to
In worst case this somehow causes a circular reference since
|
not OOM stuff, but some hard data on the perf slowdown. here's the runtime of the imageelements gatherer. this is before and after the #11188 commit specifically. (i was doing a bisect) |
After discussing with @lemcardenas, we're going to revert ##11217 and #11188 before we ship 6.3.0 |
Some changes we might make to the gatherer:
Let's collect a few slow URLs and assess these changes using the |
Disappointing, but SG. Do you have a URL list for these extra long URLs @paulirish? It's shocking to me that just the 95th percentile is hovering around 10s in LR when my typical worst offender testing sites (cnn, theverge, hulce.photography) are all ~500-700ms locally. Would be super useful to expand my repertoire :)
gCS will give you the computed width/height though and not whether that computed style was determined because of a CSS rule or the intrinsic size of the image, which is the whole point of the audit, right? |
Ah, that's right, oop! That really should be explicitly stated in the gatherer. |
Once we have some urls we can start digging in more... I'd start by adding timing marks around these three areas:
It's unfortunate we are working from a devtools node path here. Perhaps there's a way to grab the DOM snapshot (must verify that the width/height properties from the snapshot don't include intrinsic image sizes) and then connect that data to the image element we scraped. Either:
|
ya.. mentioned http://cosmetiqon.gr/ in top comment. here's a list:
yup, that's also where i'd go next. 👍 i agree with everything in yr comment. |
(re prioritizing as the revert addresses the most immediate concerns) |
thanks @paulirish that set is something else http://www.digitalcodes.co/in/ has 306 offscreen images and takes two MINUTES 😱 |
the snapshot idea i had in #11289 (comment) doesn't work for us because the |
quick followup we will do is sort the elements by image size, then apply a sensible time budget to fetching source rules. #11340 (comment) |
Update a few months later.... Turns out this core issue is still a problem. While we don't OOM as much, we're still running quite slow in some cases. The slow ImageElements gatherer (due to the changes from unsized-images) is causing problems for the LH 7.0 roll into LR. (LR currently is 6.3.0 which doesn't have unsized-images). connor's isCSS fix was hugely beneficial, but we can still do more. also the investigation in #11336 is now hugely valuable. |
We meant to follow up with a time budget. See my last comment. seems we forgot. Let's do that? |
investigating slow ImageElements with kohlswww.kohls.com (with mobile) reproduces decently well. the gatherer takes ~1s on my machine and ~5s on LR. on kohls.com, we added that
sg. i dig that. |
We were getting OOMs in LR and I managed to confidently bisect down to the commit where #11188 was merged. (its
core(image-elements): collect CSS sizing, ShadowRoot, & position
)Here's one URL where this can sometimes OOM, though I definitely can't get an OOM locally. I'm not entirely sure which context is getting the OOM.. the page or Lighthouse.
I do know that if I comment out these lines...
lighthouse/lighthouse-core/gather/gatherers/image-elements.js
Lines 353 to 355 in e0f7d51
…the imageGatherer takes 2s instead of 28s.
I attempted to do some memory debugging but didn't get too far. Still requires a bit of investigation
Similar efforts: #7274 #9818
The text was updated successfully, but these errors were encountered: