Hacker News new | ask | show | jobs
by leeoniya 2236 days ago
i just want to say, Firefox is seriously fast now, while Chrome continues to get slower [1].

my 10M datapoint uPlot benchmark runs in half the time, for both pure js (fake data gen) and canvas workloads (chart rendering). check out the console in [2].

however, i'm still waiting for the performance assessment in devtools to improve so i can get an easy summary as i can in Chrome.

also, better default form input styling would be nice. it's so...Windows 98....but i'm on Windows 10. :\

[1] https://github.com/krausest/js-framework-benchmark/issues/68...

[2] https://leeoniya.github.io/uPlot/bench/uPlot-10M.html

7 comments

> also, better default form input styling would be nice. it's so...Windows 98....but i'm on Windows 10. :\

Google and Microsoft seem to agree with you, but I totally don't get it!

If the website doesn't specify a style, my browser should fall back to a design that matches my OS, not whatever the browser developer thought was pretty!

And if Windows is coming back and telling the browser to use Windows 98 styled buttons, Microsoft should fix Windows!

> The underlying problem is Windows suggesting Windows 98 styled buttons. Microsoft should fix Windows.

i think that's the canned WONTFIX response for every bugzilla issue ever closed about it in the past, what, 7 years?

...but does that make it wrong?
> The underlying problem is Windows suggesting Windows 98 styled buttons

I'm almost positive that Firefox doesn't use OS-native controls; they've specifically styled their controls to look the way they do, so yes, this is a Firefox problem, not a Windows problem.

Really? The reason I assumed otherwise is that, the buttons on Mac look like Mac buttons to me. And furthermore, the buttons on my Mavericks Mac (pre Apple's flat redesign) look different than the ones on my High Sierra Mac.
I think it's an imitation. They're not stock UI elements. For example, on my Mojave system, if I just make an HTML button, I can see it doesn't respect the systemwide dark setting, the highlight color looks slightly darker than a normal light-theme button and it doesn't invert the text color when highlighted.
In dark mode, buttons have a darker highlight and don't invert their text color.
Safari on windows were showing osx-styled default buttons, so I think safari also implement their own UI controls, not using system's ui elements.
That’s because Safari was ported to Windows by porting a large chunk of AppKit to Windows - it didn’t make direct use of Win32.
Wow this is interesting! Does that means technically we could have any OSX app compiled for windows while still retaining OSX-like appearance? Did Apple ever released this AppKit windows port for others to use? Does apple still maintaining the port for MacOS as well or did it die along with Safari for windows?
Safari buttons on macOS are native unless you style them in a way that causes their font or size to change.
They are not OS-native, but they use OS theming information.
Right. Browsers can't use the OS control implementations, because the demands of DOM/CSS simply can't be handled by those native implementations. But Firefox is trying to emulate the look and feel of the OS controls, using native theme drawing APIs when possible. It is very hard to get 100% right, which is why no browser does.
Huh. I wonder if that applies even to Safari on Mac and iOS, given how integrated Apple likes to be with their UI controls.
Some of them are native, if you don't style them.
> Browsers can't use the OS control implementations, because the demands of DOM/CSS simply can't be handled by those native implementations. [...] It is very hard to get 100% right, which is why no browser does.

This is not correct. In instances where CSS doesn't affect the styling of the control, the browser can use native controls. As far as I know, every browser _except_ Firefox does this. For example, <select> elements in Chrome and Safari are native elements (albeit Win32 versions in the former on Windows).

Chrome and Safari are absolutely not using the actual native control implementation. E.g. on Windows Chrome is not jamming a combobox HWND into its browser window.
> In instances where CSS doesn't affect the styling of the control, the browser can use native controls. As far as I know, every browser _except_ Firefox does this.

This is not true. It's not just the styling of the control itself that makes it infeasible to just stick an NSButton inside the browser's NSView; it's about the way a control interacts with everything else on the page.

Source: I work on browser graphics.

Unstyled buttons look like Aero. CSS-styled buttons (custom color, border appearance) look like 9x.
It seems that it's faster on every website I use except Gmail, Google Voice, and Youtube. I wonder whether Google is using some sort of Chrome-specific javascript to make those sites run faster in their own browser?
I'm not sure if this is still the case, but Youtube used to use WebComponents v0 which has to be emulated in JS in non-Webkit browsers, since only Google ever implemented v0, while everyone else agreed it required a bit more work, and other engines run v1 instead, which is not compatible.
Youtube was updated to the v1 quite some time ago with a fresh Polymer version

>Polymer.version

3.4.0

Polymer uses v1 WCs since Polymer v2

Thanks! I had no idea how to check if it was still the case.
The main YouTube site seems to still be lousy in Firefox. Buttons that should open dropdowns (e.g. the top right corner user icon and notifications icon) don’t. If I want to actually see notifications, I need to tack ?disable_polymer=1 onto the URL and experience the ancient site!

YouTube Studio doesn’t suffer from these problems.

Hmm, seems to work fine for me.
I have no idea when it stopped working, because I scarcely ever used the affected buttons until very recently—I have a vague feeling it might have worked three or four years ago, but in the last couple of months it’s definitely not been working for me.

uBlock Origin is the only extension that I have that could feasibly alter anything, and all it’s doing is blocking googleads.g.doubleclick.net. Nothing of interest shows up in the dev tools. 99.9% sure the bug is with YouTube, though in what particular way I cannot guess.

I can confirm that uBlock Origin blocks the notification dropdown on Firefox. Does the dropdown get served by the ads server?
I use uBlock (and some others) and have no problems clicking either buttons
It doesn't exactly need to be Chrome-specific; every browser/JS engine will have slightly different performance on different workloads, so Google just has to lean heavily on things that are golden-path for Chrome. They could even do this accidentally/nonmaliciously just by mostly testing on Chrome and not testing performance on other browsers.
> They could even do this accidentally/nonmaliciously

Designing a development process that naturally achieves a malicious outcome is just as bad as actively making malicious decisions: https://www.zdnet.com/article/former-mozilla-exec-google-has...

Wouldn't it rather be "Maintaining and not fixing" rather than "Designing"?

Google is perfectly allowed to make mistakes or forget something. The criticism is that this is a repeated behavior, as if they decided that it is never going to be a priority.

Judging by how they treat those websites on Android on Firefox vs Chrome I am most definitely certain they are doing that.
Reminds me of the Chappelle Show skit about Kinko's:

https://www.youtube.com/watch?v=zR7LOtMix9w&t=155

"A lot of people ask, 'Why? Why treat [other browsers] this way?'"

"Why? 'cause f*ck 'em, that's why."

I can corroborate this. YouTube especially.

Does anyone have any hard numbers to validate this? Or are we just random outliers?

More anecdata: every Google product I use (GMail, Google Drive/Docs, YouTube) either works slower or eventually develops memory leaks on Firefox.
Nothing specifically malicious. Since Chrome is default browser at Google, it’s used as default development and profiling browser, and then it’s ported to and tested on other browsers, obviously not as much.
Concerning form input styling, many of the responses that have been made before this time are broadly technically incorrect or insufficient (roca’s comments are excellent, as a developer in this very space), and no one’s mentioned that work is actively happening in this space.

On Windows, Firefox currently uses Windows APIs to draw the form controls, scrollbars, &c. where possible, and imitates the style in the places that there is no native API for it.

https://bugzilla.mozilla.org/show_bug.cgi?id=1381938 introduced a new style, available behind the widget.disable-native-theme-for-content pref. I’ve been using it for the last three months and reporting various bugs and problems. https://bugzilla.mozilla.org/show_bug.cgi?id=1615105 is tracking the remaining work before it can be turned on by default.

My opinion: the new control styles are… fine, I guess; but they could do with some not-flatness (especially for buttons), and increases in size and padding are seriously problematic on many existing sites.

My LOD 3D models still take ~10ms per batch to load from binary file in Firefox, whereas Chrome needs ~1ms per batch. Mostly because of DataView but Mozilla recently assigned someone to work on it so I'm hopefull for the future.
I recently switched to Firefox after being a Chrome user for the most part of my life. In the past I couldn't switch to Firefox due to a lack of alternatives for the extensions I use on Chrome (particularly Google Dictionary) but I recently use Firefox again and decided that the performance difference is worth the change. I still miss the extension options I had sometimes but I have to admit that my overall browsing experience is markedly improved on Firefox. Glad to see that my anecdotal browsing experience is backed by benchmark.
Would love to see how Safari handles your benchmark! I find it pretty fast, but maybe that's just bias because it treats my battery nice.
I ran three trials of each on a min spec 2019 MacBook Pro 16". All numbers are ms rounded to the nearest integer, all browsers are latest stable. I also loaded the page with dev tools closed since that affected times.

Browser: (trial 1 prep, trial 1 chart), (trial 2 prep, trial 2 chart), (trial 3 prep, trial 3 chart)

Chrome: (649, 347), (638, 343), (618, 358)

Firefox: (353, 307), (358, 307), (361, 308)

Safari: (281, 264), (287, 258), (309, 262)

Similar experience. Beating WebKit on macOS in rendering performance or energy use is very hard for both Chrome and Firefox (and the clones).
Very interesting. Thanks a lot! Firefox did really well, that’s cool to see.
there's an artificial 500ms delay in there between fake data gen and chart drawing so it's easier for me to isolate the two in the perf timeline :)

> Would love to see how Safari handles your benchmark!

i don't have access to a Mac, so you won't get this from me!

Fair enough! Thanks anyway, though.
Firefox uses Direct2d on windows, while Chrome will just use Skia.