Why is PM so much slower than Firefox in loading websites?

General project discussion.
Use this as a last resort if your topic does not fit in any of the other boards but it still on-topic.
Forum rules
This General Discussion board is meant for topics that are still relevant to Pale Moon, web browsers, browser tech, UXP applications, and related, but don't have a more fitting board available.

Please stick to the relevance of this forum here, which focuses on everything around the Pale Moon project and its user community. "Random" subjects don't belong here, and should be posted in the Off-Topic board.
User avatar
LuftWafflePilot
Fanatic
Fanatic
Posts: 223
Joined: 2021-02-19, 20:46

Why is PM so much slower than Firefox in loading websites?

Unread post by LuftWafflePilot » 2023-03-06, 22:12

https://www.bike-forum.cz/forum/propain ... ts-forever
Why does this link freeze PM for 8 seconds and loads in less than two in Firefox?

There are tons of cases like this. Someone explain this to me because I am really confused. Web compatibility and standards and whatever aside, if something loads pretty much instantly in a supposedly inferior browser, the only thing I, as a regular user, can make out of that is there are some serious technical shortcomings in the PM code. But why?

BenFenner
Astronaut
Astronaut
Posts: 588
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by BenFenner » 2023-03-06, 22:16

There was a period of a few years when Firefox and Chrome both took browser performance as a main priority and marketing gimmick, and at the time that meant almost entirely speed improvements to JavaScript processing (as the HTML/CSS rendering and such was already high-hanging fruit by then) in their respective rendering engines (Gecko and Blink). I believe this happened after the final version of Firefox that Pale Moon used to fork from oh so long ago. This explains why JS-heavy sites perform noticeably faster on Gecko or Blink based browsers. And more and more web sites becoming bloated, JavaScript-heavy monsters just compounds the problem. It would be amazing if Pale Moon (Goanna) could get similar attention, but I think most users are like me and we want security/privacy/stability/compatibility above performance so we're happy to wait.

That's been my running theory for a long time, but I'm happy to be shown as incorrect if that is the case.

There should be JavaScript profiling websites out there that should be able to give you performance metrics to compare between browsers on your own system.
Last edited by BenFenner on 2023-03-07, 00:39, edited 5 times in total.

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by andyprough » 2023-03-06, 22:22

LuftWafflePilot wrote:
2023-03-06, 22:12
https://www.bike-forum.cz/forum/propain ... ts-forever
Why does this link freeze PM for 8 seconds and loads in less than two in Firefox?
Loaded in just about 2 seconds for me. Have you cleaned your profile up lately?

User avatar
Mæstro
Lunatic
Lunatic
Posts: 459
Joined: 2019-08-13, 00:30
Location: Casumia

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Mæstro » 2023-03-06, 22:36

Mæstro reads the title.
Oh no, not this again. :shock:
Browser: Pale Moon (Pusser’s repository for Debian)
Operating System: Linux Mint Debian Edition 4 (amd64)
※Receiving Debian 10 LTS security upgrades
Hardware: HP Pavilion DV6-7010 (1400 MHz, 6 GB)
Formerly user TheRealMaestro: æsc is the best letter.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2181
Joined: 2018-05-05, 13:29

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by vannilla » 2023-03-07, 00:05

BenFenner wrote:
2023-03-06, 22:16
That's been my running theory for a long time, but I'm happy to be shown as incorrect if that is the case.
It's mostly correct: Chrome's main appeal since launch has always been speed; the earliest versions even had a reduced UI for the sake of beating the competitors on startup time.
Because people started evangelizing that faster is always better no matter what, the other browsers had to adapt in one way or another.
Eventually, browsers could not be any faster simply because javascript programmers are awful (on average; there are actually some good ones out there, but are a minority) and the megabytes of scripts required by "mainstream" website hogged all the resources no matter what browsers tried (yes, even the super amazing optimized V8, used by Chrome, chokes on current-day javascript monstrosities).
This is the infamous "browser UI hang" that can be experienced on Pale Moon when visiting e.g. YouTube.
That's why multiprocess (e10s in Firefox) was created: by offloading scripts on a separate process, you can give the illusion of speed even when dealing with above-said javascript-based framework. Of course, since the thruth is not good marketing, they sugarcoated it by using another popular topic: security. Don't worry about the fact that browsers haven't been as insecure as they are now; just ignore the critics, they know nothing about security.
While offloading a script has objective benefits in that the process doesn't have to care about other stuff, thus allowing the script to run "better", this is all smoke and mirrors. Pale Moon is slow only because it doesn't hide the hard reality of the current-day WWW.
In fact, if you were to test a "scriptless" site in Firefox and Pale Moon the difference in speed would be so minimal to be unimportant (personally I think Pale Moon is faster, but I never measured scientifically).

BenFenner
Astronaut
Astronaut
Posts: 588
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by BenFenner » 2023-03-07, 00:25

vannilla wrote:
2023-03-07, 00:05
Pale Moon is slow only because it doesn't hide the hard reality of the current-day WWW.
To me, this sounds sort of like you're almost hinting that the other browsers do tricks to make it seem like they are [loading things] faster, when they are actually just as slow as anything else.
I know for a fact the other browsers do this. We all know they do this. Like showing a browser window immediately on program-load but still having the rest of the browser take just as long as it always has to give you a navigable home page. Or other tricks littered all over the place. And web developers do similar. Presenting a pulsing place-holder UI to the user while the real data/page loads.
It sounds almost like you're talking about those nasty tricks. And maybe you are?
But I don't think that we need to get into those weeds. That is a trap.

There are real, actual performance benefits found outside of Pale Moon. Ones I would love to see in Pale Moon if they make the cut and fit the ethos and the resources are there to implement, with the mind that security/privacy/stability/compatibility issues and improvements are more important.
Waving ours hands in the air and saying "that's just fake performance trickery" does us no good when trying to speak about actual performance differences. I'm not saying that's what you were doing, but it has me thinking about the topic, you know?

User avatar
Mæstro
Lunatic
Lunatic
Posts: 459
Joined: 2019-08-13, 00:30
Location: Casumia

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Mæstro » 2023-03-07, 01:32

vannilla wrote:
2023-03-07, 00:05
It's mostly correct: Chrome's main appeal since launch has always been speed; the earliest versions even had a reduced UI for the sake of beating the competitors on startup time.
Because people started evangelizing that faster is always better no matter what, the other browsers had to adapt in one way or another.
Is this the origin of the flat design that has blighted interfaces for over a decade now? Nobody has ever bothered to explain why everything had become so scanty over the years 2012–15. We cannot blame mobile phones for it: the early Android and iOS interfaces, to say nothing of their rivals in the 00s, were still sensible.
Browser: Pale Moon (Pusser’s repository for Debian)
Operating System: Linux Mint Debian Edition 4 (amd64)
※Receiving Debian 10 LTS security upgrades
Hardware: HP Pavilion DV6-7010 (1400 MHz, 6 GB)
Formerly user TheRealMaestro: æsc is the best letter.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by moonbat » 2023-03-07, 01:37

BenFenner wrote:
2023-03-07, 00:25
other browsers do tricks to make it seem like they are [loading things] faster,
That is exactly what they do, originally Apple did this in Mac OS by drawing window animations faster while it was crunching some background task.
BenFenner wrote:
2023-03-07, 00:25
actual performance differences
Like what? First they throw everything and the kitchen sink into Chrome (Gamepad support? Dolby surround sound? Obscure regex extensions for Javascript?), then stuff these features as draft specs into the 'living' HTML standard, then modify their frameworks like Angular/React etc used by every damn modern website to use these features (and thus breaking them on non Blink/Gecko browsers, namely this one), and meanwhile Chrome itself is turning into a freaking VM container as opposed to a browser and hogging all available RAM, so what performance benefits? It's easy to perform well if you're going to gobble up all the RAM and CPU cycles available to render a 'simple' website that has fewer features than it used to 15 years ago.
Mæstro wrote:
2023-03-07, 01:32
Is this the origin of the flat design that has blighted interfaces for over a decade now?
I would blame Windows 8 and the Metro UI, introduced in 2011 or so, for this idiocy. Suddenly everyone was copying it and then it went mainstream. So called 'simple' appearing while actually hogging much more resources than the much better looking Windows 7/original iOS with their 3D icons and transparency effects.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

Blacklab
Board Warrior
Board Warrior
Posts: 1080
Joined: 2012-06-08, 12:14

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Blacklab » 2023-03-07, 01:37

FWIW - OP LuftWafflePilot's example page: https://www.bike-forum.cz/forum/propain ... ts-forever... also struggles to load fully on latest Firefox too. Its a very, very long page... presumably stuffed with unnecessary scripts or graphics? Fortunately not many sites like that I come across... YouTube excepted. Sigh.

User avatar
Mæstro
Lunatic
Lunatic
Posts: 459
Joined: 2019-08-13, 00:30
Location: Casumia

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Mæstro » 2023-03-07, 02:42

moonbat wrote:
2023-03-07, 01:37
I would blame Windows 8 and the Metro UI, introduced in 2011 or so, for this idiocy. Suddenly everyone was copying it and then it went mainstream. So called 'simple' appearing while actually hogging much more resources than the much better looking Windows 7/original iOS with their 3D icons and transparency effects.
Indeed, I had had Windows 8 in mind when fixing the first date; the last was when I had noticed many sites, some of which had not changed their UI in over a decade, switching to the new form. Though I had phrased it poorly, I had meant to avoid naming mobile or responsive design, as I have seen in some discussions, as a scapegoat for degenerating web design. I think I am asking myself why Microsoft had introduced the Metro theme to begin. The question ‘what were they thinking!?’ surrounds many things with that OS, but Metro’s imprint on the digital world has been far graver than anything else.
Browser: Pale Moon (Pusser’s repository for Debian)
Operating System: Linux Mint Debian Edition 4 (amd64)
※Receiving Debian 10 LTS security upgrades
Hardware: HP Pavilion DV6-7010 (1400 MHz, 6 GB)
Formerly user TheRealMaestro: æsc is the best letter.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by moonbat » 2023-03-07, 03:22

Mæstro wrote:
2023-03-07, 02:42
I think I am asking myself why Microsoft had introduced the Metro theme to begin.
When I first heard of Windows 8, that it would work seamlessly across mobile and desktop, I thought they would have a good thing going, given their efforts to break into mobile having failed until then. I thought they meant what they said - given the beauty of Windows 7 and power of older Windows Mobile devices. Never expected them to kill the traditional desktop and force their dumb simple UI everywhere, for a lousy tiled OS that was even less functional than iOS of its time.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

Blacklab
Board Warrior
Board Warrior
Posts: 1080
Joined: 2012-06-08, 12:14

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Blacklab » 2023-03-07, 03:35

That 'dumb simple Metro UI' had some pretty obscure problems for the average user too!

An elderly gentleman appeared in our charity office one day about 5 years ago clutching his Windows 8 laptop and complaining that he couldn't find hundreds of emails he knew he had received. Not being a Windows 8 user, it took me some time to work out that the 'Metro Outlook Mail App' was set to display only a certain number of the your most recent emails... and that you had to access the full Windows 8 desktop, open a proper browser, and then open 'proper' MS Outlook.com online to see all your emails! That was a well hidden 'user-unfriendly' gem. :thumbdown: :thumbdown:

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by moonbat » 2023-03-07, 03:47

Not only that, they started the practice of stripping out useful features in the name of simplicity, which was adopted by Mozilla as we all know. Today a so called 'simple' website takes several times the system resources of its 15 year older version to provide much less functionality by contrast.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Sob__
Lunatic
Lunatic
Posts: 251
Joined: 2014-02-17, 01:12
Location: CZ

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Sob__ » 2023-03-07, 03:49

vannilla wrote:
2023-03-07, 00:05
In fact, if you were to test a "scriptless" site in Firefox and Pale Moon the difference in speed would be so minimal to be unimportant (personally I think Pale Moon is faster, but I never measured scientifically).
Trouble is, mainstream left scriptless long ago and too often went right to overscripted. I hate it myself and I think it's wrong, but it's the reality. Even if Pale Moon was ten times faster on scriptless sites than anything else, nobody would care, because the sites they want to use are not scriptless. One may choose to ignore such bad overscripted sites, but that's nothing for average user. Like, try to ignore YouTube. It doesn't work, people don't care about the site itself, they care about the content they can find there, and lot of it is only there and nowhere else. And it's just one example out of many.

As for multi-process vs multi-thread, users couldn't care less, it's unimportant technical detail. But they usually do care about hanging UI, it's bad experience. Back then when computers had one slow core, it was understandable. But how can anything hang even on some super-modern fifty-cores PC? Ok, fine, so some script in one tab went in crazy endless loop, let it squeeze ten cores to the max. And another tab can take another ten while rendering some million-lines html table. But with another thirty cores doing nothing, I can stil have snappy UI and do something else in third tab, right? Turns out, I can't. But it means that there's some bottleneck, some shared part that gets overloaded, and it's bad. And clearly it's not easy to fix, when everyone else rather went with multi-process. Even it it might be "illusion", it really seems to work better.

For the record, I'm not trying to be mean and criticize too much. Also there's that thing about not shooting messengers. ;)

User avatar
LuftWafflePilot
Fanatic
Fanatic
Posts: 223
Joined: 2021-02-19, 20:46

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by LuftWafflePilot » 2023-03-07, 06:27

Blacklab wrote:
2023-03-07, 01:37
FWIW - OP LuftWafflePilot's example page: https://www.bike-forum.cz/forum/propain ... ts-forever... also struggles to load fully on latest Firefox too. Its a very, very long page... presumably stuffed with unnecessary scripts or graphics? Fortunately not many sites like that I come across... YouTube excepted. Sigh.
The site is a horrible fucking mess, which even someone like me with zero knowledge about programming and web development can tell. However, there are tons of shitty websites out there, and I would say browsers should be optimized for that. If Javascript is this bad and programmers who write in it are mostly incompetent clowns, unfortunately this only leaves the browsers with the shitty job of making it less of a pain in the arse...

I'm not saying Firefox doesn't struggle loading this particular page compared to more "normal" websites, but it does so several times faster than PM, and I don't think the multiprocess aspect of it makes a lot of difference. Yes it doesn't freeze like PM does, but the actual time before posts appear is easily four times faster. Whatever Firefox does it must be doing it really well, which is something that shouldn't be overlooked.

User avatar
andyprough
Astronaut
Astronaut
Posts: 688
Joined: 2020-05-31, 04:33

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by andyprough » 2023-03-07, 06:49

LuftWafflePilot wrote:
2023-03-07, 06:27
However, there are tons of shitty websites out there, and I would say browsers should be optimized for that. If Javascript is this bad and programmers who write in it are mostly incompetent clowns, unfortunately this only leaves the browsers with the shitty job of making it less of a pain in the arse...
There are already plenty of browsers that do exactly that. Unfortunately, the reason those browser companies are doing it is because they are selling users' browsing history, location, and disturbing amounts of private data. They want their users visiting as many sketchy sites as possible and leaking more data that they can scoop up and sell.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35404
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Moonchild » 2023-03-07, 09:38

Actually, Pale Moon is not "much slower than firefox" in how it operates. The websites you are talking about are loading just as fast in Pale Moon as they are in Firefox, since we're doing the exact same thing in that respect: DNS lookups, network requests (including full http/2 multiplexing and more complex things to shave off milliseconds everywhere), downloading data, decompressing it, parsing it. All of that is very fast is both browsers. Even just-in-time compilation is broadly the same making Javascript execution near-native code speed.
If that wasn't the case, every website would be slow, but that's not the case. It's only some, and there is the big clue to what is going on.

So where does this perceived slowness come from then? Well, the websites that are problematic do not have any meaningful content except what their scripting barfs out on the screen, so everything ends up being bottlenecked into content-translating scripting. Once again it's not that our scripting engine is slow; far from it. But what happens more often than not is that the scripting checks for specific native features and if even one is missing it will go into "fallback mode" (if they even have one) which will then assume nothing they want is supported and emulate it (through replacement, unoptimized javascript code). As anyone with some computer experience knows, emulation is terribly slow. so then you end up with a single channel to create content in the browser, and that being restricted by slow scripting. Why this fallback code is slow is a different question. In some cases it might be deliberate, but in most cases it's likely just not wanting to invest time to cater to making an efficient fallback for wanting to use the latest shinies. A good part of this also has to do with people just blindly using async everywhere without understanding what they are doing, and then you have scripting waiting for other scripting waiting for other scripting waiting for.... which compounds the wait times exponentially. And that is not a level of clowning around a browser engine can fix.

Creating web content this way is like using a garden hose. everything has to come through its narrow circumference. If you pinch the hose anywhere along its length, or try to stuff something through it that shouldn't be there, the result is terrible; but does that make it a bad hose?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 932
Joined: 2021-01-26, 11:18

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Kris_88 » 2023-03-07, 17:18

LuftWafflePilot wrote:
2023-03-06, 22:12
https://www.bike-forum.cz/forum/propain ... ts-forever
Why does this link freeze PM for 8 seconds and loads in less than two in Firefox?

There are tons of cases like this.
Actually, this is a very non-typical example.
About 150,000 lines HTML. Firefox can not even display a page source.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35404
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by Moonchild » 2023-03-07, 20:47

Kris_88 wrote:
2023-03-07, 17:18
About 150,000 lines HTML.
Wow, for real? Well long pages like that simply do take time to parse and render. Arbitrarily chopping it up into chunks a la mobile rendering engines might improve load times in that case but that's complexity I don't want to even think about.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 780
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: Why is PM so much slower than Firefox in loading websites?

Unread post by jobbautista9 » 2023-03-08, 01:36

Oh my god. Why does that forum not use pagination at all? Of course it's gonna load slow. If it's social media, I'd understand, but it's a forum for god's sake. Even Reddit (at least the old version) doesn't load all comments right away if they're many...

Moonchild is correct; the mainstream browsers do divide the page into chunks, which is why it loads "faster". Mozilla has been async'ing pretty much everything, including the scrolling. But this leads to the issue of checkerboarding where if you scroll really fast in a very long page like that one from that forum, the content paint fails to keep up. This shows as the viewport being blank for a moment before the content becomes visible. See Mozilla bug 1699888 which I filed.

Mozilla has been trying to reduce the checkerboarding ever since, but I haven't seen progress on that so far.
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

Locked