Bug 198530 - Improve performance of the lazy image loader
Summary: Improve performance of the lazy image loader
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Website (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jon Davis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-04 08:26 PDT by Jon Davis
Modified: 2019-06-04 19:25 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.94 KB, patch)
2019-06-04 08:41 PDT, Jon Davis
no flags Details | Formatted Diff | Diff
Patch (6.97 KB, patch)
2019-06-04 10:53 PDT, Jon Davis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Davis 2019-06-04 08:26:26 PDT
Improve CPU performance on webkit.org pages by using an IntersectionObserver implementation.
Comment 1 Jon Davis 2019-06-04 08:41:17 PDT
Created attachment 371285 [details]
Patch
Comment 2 Devin Rousso 2019-06-04 08:55:55 PDT
Comment on attachment 371285 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371285&action=review

r=me, neat!  It may be worth a simple `if (window.IntersectionObserver)` check around (or as an early return in) `lazyLoadImages` so we don't throw an error if it's not supported.

> Websites/webkit.org/ChangeLog:-101
> -        

I don't think we normally go back and edit ChangeLog entries, no matter how "bad" they may be.

> Websites/webkit.org/wp-content/themes/webkit/scripts/global.js:-2
> -    var openClass = ' open-menu',

A comment explaining why this isn't needed would be nice :)

> Websites/webkit.org/wp-content/themes/webkit/scripts/global.js:6
> +        for (let table of tables) {

Are we using `let` now??!? =D

> Websites/webkit.org/wp-content/themes/webkit/scripts/global.js:22
> +        if (backgroundImages.length == 0)

NIT: you could use `!backgroundImages.length` instead
Comment 3 Jon Davis 2019-06-04 10:53:23 PDT
Created attachment 371301 [details]
Patch
Comment 4 EWS 2019-06-04 18:43:35 PDT Comment hidden (obsolete)
Comment 5 WebKit Commit Bot 2019-06-04 19:21:32 PDT
Comment on attachment 371301 [details]
Patch

Clearing flags on attachment: 371301

Committed r246094: <https://trac.webkit.org/changeset/246094>
Comment 6 WebKit Commit Bot 2019-06-04 19:21:34 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-06-04 19:25:08 PDT
<rdar://problem/51425204>