For a long time I've been intrigued by #Epiphany taking 3 to 20 seconds to load most websites on startup or in Incognito Mode.

Today I tested a bunch of configurations to report a bug, profiled… and it turned out to be 2 bugs in 1 

* The adblocker (and similar features) makes things slower  : https://gitlab.gnome.org/GNOME/epiphany/-/work_items/2880#note_2766101

* WebKitGTK is doing some shenanigans with the system's fonts: https://bugs.webkit.org/show_bug.cgi?id=315135

#GNOMEWeb #WebKitGTK #GNOME #Sysprof #profiling #performance #Linux

"But but but compared to my Core i9 fighter jet, your old Intel Xeon is slow to compile adblocking lists on the fly! 🧐"

Well, my standard is Firefox (w/ uBlock Origin) that loads those websites in less than 500 milliseconds at all times on the same CPU 🤷

Ideally we need something more efficient for content filters in #WebKit. It would certainly have a big impact for #LinuxMobile processing speed & battery life. Imagine underpowered mobile chips having to bruteforce through this 😬

#MobileLinux

@nekohayo How often do they change? Create a mmap'able data structure and rebuild it occasionally?
@chergert @nekohayo compiled filters in WebKit are already compiled into mmapable bytecode, and compilation happens in a worker thread. I am going to guess it's more about how Epiphany uses the API rather than some foundational issue on how things are internally in WebKit 
@chergert @nekohayo something that might be worth checking is where temporary files are created for compiling the filter rules. If the temporary file used for the bytecode lives in a volume different than the home cache dir there might be a copy involved before the compiled bytecode can be mmaped.
@chergert @nekohayo actually checked this... and indeed we end up placing files under the directory returned by `g_get_tmp_dir()`... and that will be `/tmp` most of the time, which easily can be a tmpfs or in some volume different that the home directory where compiled filters are ultimately stored. Which means we end up copying synchronously, and it has been like this for years 😱
@aperezdc @chergert
I love it when I encounter a "spacebar heater" performance bug that flew under the radar for years because y'all live in a searing-hot climate with power-efficient CPUs 🤣
@chergert @nekohayo ...aaand we have a fix that will be merged: https://github.com/WebKit/WebKit/pull/65336
Content rule list store may end up copying compiled bytecode files by aperezdc · Pull Request #65336 · WebKit/WebKit

82c56f0 Content rule list store may end up copying compiled bytecode files https://bugs.webkit.org/show_bug.cgi?id=315236 Reviewed by NOBODY (OOPS!). Add a third parameter to WTF::openTemporaryFi...

GitHub