Bug 239934

Summary: [GTK] Painfully slow browsing experience
Product: WebKit Reporter: Dennis Nezic <dennisn>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Enhancement CC: bugs-noreply, kdwkleung, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 245783    

Description Dennis Nezic 2022-04-30 15:08:18 PDT
With every update, my webkit-gtk browsing experience gets slower and slower, the libwebkit2gtk and libjavascriptcoregtk get bigger and bigger. Most sites are currently basically unusable. They literally take minutes to load with 100% cpu. The sites I'm visiting haven't functionally changed -- I'm still just looking for TEXT and IMAGES. For example, my bank's website.

Has anyone tested this browser on "older" hardware? For example 2Ghz "single core" ? How tf are 2 GIGAHERTZ not enough to render TEXT and IMAGES?

(I won't even mention how it takes over 24 hours to compile, how some .o files (there are currently ~11,000 in total) take OVER SIX HOURS HERE (with lots of swapping), how I can't compile with -O2 ... I can just barely get by with -O ... and the browser is *completely useless and unusable* without the -O flag. (I did try that :|))

Are there any environment variables or preprocessor flags I could set to speed things up?
Comment 1 Dennis Nezic 2022-05-06 18:04:59 PDT
Maybe the issue is that I only compiled it with "-O" ? Have you guys tested it with that? I remember the improvement from using no optimization flag to -O was HUGE (no optimization was completely unusable). So maybe I'm missing some other kinda essential optimizations that only happen with -O2 and -O3? (However, like I said, I really can't compile with -O2, I tried. I can just /barely/ manage with -O. Like I said, a few of the files take *over 6 hours* to compile, non-stop thrashing my swapspace, making my machine unuseable during that time.

Here's a recent site that has been performing especially poorly for me. When I try to login ("cra signin") to https://www.canada.ca/en/revenue-agency/services/e-services/e-services-individuals/account-individuals.html it takes over *80 seconds* to load, and when trying to enter my login name it can take *12+ seconds* between my keypress and having the letter show up in the input text box! Throughout this whole time my cpu is ~100%, burning my fingers. Memory usage is okay. What the hell is it doing? It's just a simple looking webpage with a username/password form!?!

By the way, how is it even possible for compilation to require more than, oh, 1 gig of memory?? The entire text of Encyclopedia Britannica is 1 gig!
Comment 2 Kdwk 2023-04-27 02:31:01 PDT
This cannot be reproduced on my machine and with Gnome Web 44.2 Have you tried with the official Gnome Web Flatpak so as to minimize variables confirm it is a problem with Gnome Web's stock configuration?
Comment 3 Dennis Nezic 2023-04-27 04:09:38 PDT
Roughly how "old" is your machine? Is it single-core?
Comment 4 Kdwk 2023-04-27 04:31:13 PDT
My machine is very new compared to single-core CPUs. Have you tried to compile FireFox and use it to browse the sites you mentioned? Is it much faster than Epiphany?
Comment 5 Dennis Nezic 2023-04-27 05:21:23 PDT
(In reply to kdwkleung from comment #4)
> My machine is very new compared to single-core CPUs.

Yea this "bug" seems to only affect "older" machines. Ie. there no longer seems to be a useable "modern" browser for a lot of computers out there.

> Have you tried to compile FireFox and use it to browse
> the sites you mentioned? Is it much faster than Epiphany?

Ooof man, Firefox is so much worse, so much more bloated. No chance whatsoever to compile that here. It requires TEN GIGABYTES of diskspace and god knows how much ram. Clown world.
Comment 6 Kdwk 2023-04-27 05:32:35 PDT
Well, if Firefox is same or worse I’m afraid there’s not much to be done… we mostly use Firefox as a benchmark for performance improvements. 

The fact is that the modern web is very complex, and therefore web browsers need to be equally complex. The WebKit source, for example, is nearly 10GB. If you look at wpt.fyi, a cross-browser effort to track web compatibility, you can see there are more than 1.8 million tests that form ‘full conformance’ to the web standards. WebKitGTK currently passes more than 1.74 million of them (Firefox is nearly 1.74 million). 

Besides, you can use —makearg=“-jx” to control how many build jobs to run in parallel, where x is an integer (lower uses less RAM but takes longer). For reference, on my 16GB RAM 9th-gen i7-9700 (8-core) machine, I use -j5 so that it doesn’t run out of memory.
Comment 7 Kdwk 2023-04-27 05:48:05 PDT
*--makeargs="-jx"
Comment 8 Michael Catanzaro 2023-04-27 06:46:14 PDT
I don't think there's anything actionable here, sorry.
Comment 9 Dennis Nezic 2023-04-27 08:10:37 PDT
(In reply to Michael Catanzaro from comment #8)
> I don't think there's anything actionable here, sorry.

How about getting a dev or two to try compiling/running this app on an "older" single core computer?