nekohayo, It turns out that GitLab's homebrew PDF files previewer is so wildly inefficient that it is an excellent performance torture test for any browser engine, not just WebKitGTK but also #Firefox.
I have reported an issue here in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1893884
…but I have been unable to capture a performance profile so far. If anyone manages to do so, that could be quite helpful to add to the report!