Posted
by
timothy
on Saturday April 30, 2011 @06:07PM
from the gotta-have-a-benchmark dept.

dkd903 writes "Mozilla's Mike Hommey has announced on his blog that his team at Mozilla has finally managed to get the Linux builds of Firefox to use GCC 4.5 with aggressive optimization and profile guided optimization enabled. All this simply means that we can now expect a faster and less sluggish Firefox browser on Linux (both 32 bit and 64 bit systems)."

I haven't really kept up, so I don't know exactly what the various channels are supposed to be. But, I know that I have the nightly channel enabled in Synaptic, and that my Nightly reports itself to be 6.0a1 My Namoroka, on the other hand, reports itself to be 3.6.18pre I might get interested enough to figure out where versions 4 and 5 are. Then again - maybe not.

As a long-time Firefox and GNU/Linux fan, this is excellent news. Whenever I use Firefox on even the most basic windows installs, it's always faster than my desktop running Arch Linux. It lags left and right, sometimes takes forever to switch tabs, but it's not unusable. Thanks Mozilla for remembering that you have a lot of Linux-using fans!:)

What's funny about FF bugs is the continual denial, until they actually comes out with a version that fixes something. (Remember the memory bugs, and how it wouldn't release memory after closing tabs?)

Anyway, FF is fast and light on Windows. I often have 10s of windows with 10s of tabs in them (database, sql, programming language, HTML, other references). CPU load is light (max 13% or so, usually 3% for FF).

On Linux (Ubuntu)? FF is a hog. I only run it on the odd site that doesn't work with Chrome

You're not bitching about memory leaks. Memory leaks would be indicated by progressive increase in the amount of memory used over time, without functional changes is your usage of the app. That's not what's indicated by my tests on both Windows and Mac. I run with many tabs open, and FF's memory usage is directly related to the number of tabs I have open. When I shed a window or a set of tabs, FF shrinks in memory footprint.

If you were bitching about memory leaks, that would be a perfectly reproducible problem, and a standard memory profiler would catch these things, and any contributor to FF could easily submit patches to clean up the leaked memory. Memory bloat is a more systematic problem that is much harder to keep a handle on. No matter what, new features need memory to work, so as an application ages it would be prone to increase it's footprint. That's the hard problem, and that's what I think the FF team should take some time to focus on, now that they are reaching acceptable responsiveness in general.

I've experienced FF using over 2G of memory after some use. Who should I blame? I spent several hours to narrow it down to greasemonkey, though I'm still not sure which script.

Complaints about memory leaks will persist, even if caused by the plug-ins and extensions. Rather than dismiss and ignore the complaints it would help the overall user experience to if it were easy to identify the cause---a "standard memory profiler" may catch leaks in a (dev?) firefox build, but there's no convenient way to figure out which plug-in is causing an actual user problem, let alone where the leak comes from within a plug-in. Asking users to perform a binary search disabling plug-ins is ridiculous---an option that showed how much memory each plug-in is using would at least easily allow blame to be allocated appropriately.

That's a good point. As we've been sandboxing things into separate processes (re: flash), it would be great if the allocator for XUL were patched so it could know which plugin is producing/using what memory. [I'm imagining "allocateWithZone" from objective-c] Then, you could have a clear panel which would indicate which subsystems are consuming more and more memory. This would allow us to point at various builds of greasemonkey (from your example) or firebug or other "fluffybunny" plugin. Further, we'd have

There's no way of knowing how much memory each extension is using. Extension code is thrown into a big JavaScript/XUL soup with shared data structures. With the new Jetpack API [mozillalabs.com] it may be possible to determine how much memory and CPU each extension is using. Even if some users do need to find which extension is causing memory usage problems, there is a list of the extensions that cause the most problems [mozillazine.org].

I don't know why, but I don't experience these problems. Perhaps I don't have enough Greasemonkey scripts.I mean, I typically end up with around 1.5gb or so of total system usage with:1. 50 FF tabs open and loaded2. FF given a memory cache of 1GB to play with3. Firefox's disk cache symlinked to/tmp/, which has been mounted to a tmpfs(ram-backed fiesystem).And I don't care!See, after getting 4gb of ram, and having like 6 more in swap, I don't worry about memory usage: I want things to use as/much/ memory a

We can't daydream and imagine we can acceptably run modern websites, let alone 50 tabs of them, on decades-old machines. But if the developers themselves are recommending 512MB, then the user should have an acceptable experience at 512MB, not 4GB.

Microsoft recommended 128mb of ram for XP. How well does it run on that?Microsoft recommended 1GB for Vista. Same thing.Yea. So, recommended settings aren't anywhere what you need for good performance. Firefox will run on 512mb of ram, but unless you're still running a P4 and XP, you probably have 2GB or more.

Memory is getting relatively cheaper and cheaper. We demand that our OS as well as our browser do more and more. Sandboxing, preloading sites, javascript tasks, Flash and Java, along with music and movie playback in various encodings.

Today, if I were selling machines, I would be ashamed to sell a machine with less than 4 gig of memory installed. I tell everyone to load their board with all the memory it will hold - typically, 4 sticks of 2 GB. It won't be wasted. Pe

The most memory I've ever seen my Firefox using was just over 1.5 gig. I closed about 30 tabs, and the memory dropped to about.5 gig. So - you might blame yourself for having so many windows and tabs open?

I've had FF hit over 1.5Gb RAM after around 6 to 10 hours, even though I close tabs and only have on average 5 open. Do I know why FF does that? Nope, but I do know that Chromium based (Comodo Dragon) don't do that, so that is why I've been switching. I just fired up FF 4 to type this out and I can literally watch the CPU usage go up as I type. If I type fast enough I can even hit over 60% on the 1.8Ghz Sempron I use for a low power nettop. Hell just sitting here doing nothing it is using 24% CPU, that's ju

If you think you see a memory problem, the thing to do is post a set of steps that can reproduce the problem. In every test I've seen, Firefox uses less memory than other browsers. Perhaps there's a problem, but you need to point out precisely what the problem is before it can be fixed. Asking for "memory usage problems" to be fixed is a vague as asking for "security problems" or "crashes" to be fixed. If you think you see a security problem, give the specifics of the problem. If you think you see a crash,

There are tons of more [dotnetperls.com] extensive [lifehacker.com] tests [tomshardware.com] than simply leaving the browser running all day, and Firefox uses the least memory in nearly all of them. Perhaps Firefox leaks on your computer, but not on mine and nearly all other users. If its trivial to trigger the memory leak you're seeing, then it should be trivial to make your own test that we can run that demonstrates this memory leak we don't seem to be able to see.

I leave multiple instances and multiple versions of Firefox open for weeks - and I don't notice all this leakage that's being talked about. Firefox sometimes seems to USE a lot of memory - but when I notice that, I look to see how many windows and tabs I have open, and close some. Memory usage drops significantly when I do.

Firefox isn't perfect, but it isn't the piece of shit that some here seem to think.

And Firefox doesn't have problems or leaks, they have features which can be controlled. Rendered pages stay cached in memory, so they load faster if you hit the back button. You can disable this if you want.

Actually the desktop Linux market is much higher than 1% which was coined by ill informed journalists back in the early 2000's and even today we still see that quote carried forward. The Linux desktop market in most so called first world countries may be small but it is at least greater than 5% and in third world countries it much higher still, however the problem is how to come up with figures since most desktop PC's sold come with a MS OS (The Microsoft tax) and that makes it difficult to determine what n

This is "usage" as measured by the number of visits to websites across the world using different operating systems. There is no bias here because of what system the machine came with. This is the system as it's running when connecting to the Web.

However according to Hommey, these new faster and less sluggish builds of Firefox for Linux will be available only from Firefox 6 onwards and we expect the first beta of Firefox 6 to available only by September - October 2011.

True this. I am testing the nightly build on both Windows Vista and Ubuntu 11.04,and it hasn't crashed on me yet. And I can confirm that it is extremely smooth on Ubuntu, I would in fact say that it's perceptibly smoother than the Windows build.

Most extensions don't work yet, which is expected. Although, AdBlock, NoScript and WoT surprisingly work.

However according to Hommey, these new faster and less sluggish builds of Firefox for Linux will be available only from Firefox 6 onwards and we expect the first beta of Firefox 6 to available only by September - October 2011.

Note that you do not need to wait, if you are ok with running a Nightly build [mozilla.org]. Nightly builds are the latest code, so they are obviously less stable. But you can get this improvement right now if you want it.

Otherwise, you can wait just a few weeks and Firefox 6 Aurora will be released, which is somewhat more stable, and will include this code. (6 weeks later will be a Beta, and 6 weeks after that, a stable release.)

I think by "Linux Friendly", he meant that it was developed with Linux mainly in mind, and that it integrates well with it. I love Epiphany for GNOME, honestly, as a second choice. It has tabs on bottom by default (slashdot trolls, take note!), it runs fast and with low memory, it has a built-in ad blocker, and it integrates with GNOME 3 perfectly. It isn't as feature-filled as Chrome, but it works very well.

Did they fix their little font problems ? I gave up on chrome under linux because whenever I finally managed to get proper anti-aliased fonts, each time the next new version would wreck havoc and send you back to the dark ages of pixelated characters. My eyes are too old to bear with that stupid game. This, and of course, the stupid use of the title bar to store tabs that have nothing to do into my window manager layout.

I loved Firefox for the longest time.I did. When it came out, it was so light and fast, that it put it's predecessor the Mozilla browser to shame. It was no contest. I even went so far as to buy the T-shirt, and go out of my way to enlighten every non techie friend I possibly could about it.

Over the years, Firefox got slower as my computer got faster. A lot slower, but I had to keep the update cycle going on my machine because for the most part... I didn't really have a choice. Today, Firefox on Ubuntu is almost totally unusable. It sucks up 99% of my system resources when I have two gmail windows open, it's always processing weird network requests, and it's so incredibly slow that I just don't feel like I want to have anything to do with the browser anymore.

Meanwhile, Google Chrome has added a Bookmark manager, and Firebug is available. Chrome also gets very regular updates from Google, and even with every possible stupid extension I like, it doesn't slow down. Granted, half of my extensions don't work right, and that's annoying, but the browser itself does what I want, at the speed I want it.

I really think Firefox has missed the boat here.I might change my mind, but I'm in absolutely no hurry to try it out (as a web browser, it's a marvelous sqlite tool) again.

Sounds like you're a Speed fan. So a great technique I learned a while ago is "Blue Sky" thinking - just suppose you wake up one day and an Aurora Build of FF has some Crazy optimization that makes it all go 3X faster. Would you return to Firefox?

I think the very low barrier to entry from the user perspective that woke us up from an IE-dominated web is now getting a little gritty. Feels to me we're sorta playing them off each other now.

I've been using Linux long before than even Firefox existed, but I don't remember downloading Firefox from their website (so their builds) for Linux since it was the de-facto browser of choice of Linux desktop. I believe most users of Firefox on Linux use build of their distribution. Not to mention that also means couple of millions less for their download count.

Though, maybe their way of doing it or updates in makefiles help maintainers of distributions to put better builds. I guess that's what matters, not their own build on web page.

Though, maybe their way of doing it or updates in makefiles help maintainers of distributions to put better builds. I guess that's what matters, not their own build on web page.

Exactly, yeah. Most Linux users probably get Firefox through their distro, but the effort and patches that got this improvement done, will allow distros to compile in the same way and get the same speedup. If everything goes right, distros should be able to compile with these options and things will just work.

No, in a UI-based program that reacts to a user's actions or its own internal timers in an event loop, everything speed-related has to do with the turnaround time between an event firing (a user click, a URL being entered, or a JS timer going off) and the result of that event being displayed to the user -- i.e. latency. So latency is really just the inverse of "bandwidth" or "speed" as you put it, within the UI paradigm.
faster => decreased latency.
sluggish => decreased latency.

I presume they had a human readable profiler before; but profile-guided optimisation is something different. TL:DR version, the compiler looks at the profiler stats, and optimises the code so that the most heavily used parts get priority

PGO: Profile-Guided Optimization [wikipedia.org]. A FF PGO build will compile an executable with with profiling on, the run that executable using an automated script that drives the browser through a suite of tests that is intended to mimic typical usage. The results of this profiling are written to a file and then a second, optimized build is done using the profiling results as a guide for the optimizer to generate better code for the hotspots.

I've been doing it with FF4 on my Mac with Snow Leopard for some time. It does

Does that mean they weren't using a profiler before now??
That... actually explains quite a bit...

No, we use profilers;) In fact we have some valgrind - the awesome Linux profiling tool - devs working here.

Profile guided optimization is something else though. It is a special way of compiling and linking, that the compiler and linker use profiling information to know how best to optimize the code. So code that is used a lot is compiled with -O3 (the most optimizations), while code that is not used a lot gets -Os (to take less space), and so forth. This is a very useful technique that was not available on Linux until last year, and the news today is that Firefox now builds properly with it and there is a nice noticeable speed improvement for Linux users.

Just tried the nightly, and there's definitively a perceived speed boost. I can't compare to windows version, but it's there on linux for sure. Easy as downloading the nightly to a local dir in your home, unpack and run. Better, some odd layout bugs of the stable seem to have disappeared too.

I was a Mozilla/Firefox (and Netscape before that) user for many, many years... going all the way back to Netscape 3.01. I finally jumped to Chrome about a year ago, when the sluggishness of Firefox on Linux really started to piss me off. I've found that I really like Chrome's streamlined, minimalist approach; and IMO the recent addition of native PDF rendering capability is another feather in Chrome's cap. Even if Firefox manages to match Chrome's speed, that's not likely to get me to switch back...

Acceleration works just fine depending on the drivers. Nvidia proprietary is going great, though I'm not sure about Intel. ATI Isn't even in the game.
But yeah, ever since Flash 10.2 & the more recent major Chrome revisions, no more 2FPS flash video on a netbook! Haven't exactly been following FF but yeah...

I'd call you a troll, but some people do have this issue.For me, however, I have way better luck on Linux than anything else.Running this stress test: http://demos.hacks.mozilla.org/openweb/HWACCEL/ [mozilla.org] gives me: 450fps* in FF 6.0A1(latest nightly), 45fps in Reconq, and about 30fps in Chrome!

(*Note: Set minimum timeout to 0 in ff prefs, also remove the two lines of code in the above test that limit the output number to 60fps)Compare this to about 22fps on Windows XP on Firefox on my fathers machine, which is alm

There is this video card called the "Voodoo" which has decent 3D acceleration on linux and there is also one called the "Matrox Millenium". I've got no idea how you managed to get hold of Firefox in 1996 or managed to get your posts on Slashdot to us in 2011 but please stop bothering us here in the future about problems already solved back in your time.Also sorry to disappoint you, but we don't have flying cars yet.

I think that the lack of guided optimization on gcc is a fair indication that Microsoft offers a better compiler, but I also think it's a long way from "gcc lacks an option that helps Firefox" to "Linux is for masochists". Seriously, Firefox scored better on some JS benchmarks on Windows than it did on Linux, but that doesn't make the Linux version unusable or painful.

Anyway, many of us don't use GNU/Linux because it is unfailingly better than alternatives, but because we have an understanding of and appreciation for economic and intellectual liberty which is better served by GNU systems. We regard the use of proprietary systems to be masochistic.

So just grab an alpha/nightly? They've got a nice download page for em, and/usually/ they work right. Just keep one or two older nightlys around so when they/do/ break something, you can go back to that. Or simply disable updates.

Sorry man, you fell for a really weird version of the Version Number Marketing. Except this time, you seem to be saying they don't deserve to put good features in the next version?! Firefox "5 and 6"... ARE 4.1 and 4.2!

You're thinking of the long exhausting push to make FF4. But for X reasons, they chose to amp up the version numbering, as well as to drill out a couple of features.

Yes, "it took them too long", that's what we all spot Linux for, right? "Give us features, don't worry about polish" right?

Hi, I'm a Firefox dev. That sounds very bad. Can you please give some more details about how to reproduce it: Are you using a new profile? Are there any addons and plugins installed? What websites do you visit? And what specific Linux distro are you on?

Note that this might not be a bug: For example, if you visit a website that shows 200MB of images, then close that tab, then the memory is not necessarily freed. The reason is that the page stays cached, so that if you do 'History->Recently closed tabs' and open it, it will appear quickly. On a machine with lots of memory (most these days), that behavior tends to work better than releasing pages aggressively. However, if you aren't visiting websites with extreme memory use like that, then this might be an actual bug.

Getting back to your problem: With a new profile and no addons or plugins, we are unaware of a bug that causes anything like that. So I would be very grateful to you if you can point us to a bug we don't know about, so that we can fix it. If you give me steps that I can use to reproduce the problem (on my Linux machine over here),then you have my promise that I will l personally look into this and do everything in my power to fix it.

Thanks for the valuable feedback to the OP. Comments like this keep me coming back to Slashdot.

Out of curiosity, is there an option to turn on aggressive releasing of pages? It seems to me to be a good idea, but without being familiar (even remotely) with the source code and design perhaps there are reasons against this (if there is indeed no option to turn it on/off).

Thanks for the valuable feedback to the OP. Comments like this keep me coming back to Slashdot.

Out of curiosity, is there an option to turn on aggressive releasing of pages? It seems to me to be a good idea, but without being familiar (even remotely) with the source code and design perhaps there are reasons against this (if there is indeed no option to turn it on/off).

Cheers

You can simply tell Firefox to not cache anything by setting browser.sessionhistory.max_total_viewers to 0 in about:config. Then once you browse away from a page, it's memory will all be released. More details here [mozillazine.org]

The problem with this is that pressing 'back' will mean a complete reload of the page you just left. At least in my experience, caching pages is almost always worth it (unless you have machine with very limited RAM).

I'm glad you're weighing in. I see these reports from time to time, and even today when I was sure that the memory being used by Firefox was going to be some ridiculous number, it ended up being 253mb. I'm always curious when people claim that their install has some sort of massive memory leak.

Interesting... I thought this was normal. 7-800 MB would be nice. I usually close it down when it hits 1.6 to 1.7 GB. I'm almost there now as you can see -> http://i.imgur.com/WRCRG.png [imgur.com]. It gets very sluggish even on my new 64bit hexacore system, 8 Gig RAM, SSD. It could be a plugin or addon but I'm not running anything too crazy. How can I determine if it is an addon or a plugin? I'd be glad to provide all the profiling information that you need. Here are the addons that I'm running http://i.imgur.com/i [imgur.com]

AdBlock and Firebug are both know to cause memory problems in some cases. I believe this will, at least in part, be fixed in Firefox 4.0.1 - which was launched the other day I think (maybe you already updated to it). But even so, they are good first suspects. Firefox lets addons modify a lot of internal things, which makes useful addons like AdBlock and Firebug possible, but also gives them the opportunity to (easily) create memory leaks.

In general, though, my best suggestion would be to see how things are without *any* plugins or addons. Simplest way is to create a new profile, and disable plugins and addons in it. Then browse for a while and see how things are. Odds are, you won't see strange memory behavior, and then the question is, which addon or plugin it is, and you can reenable them one by one til you find the guilty one.

Long-term, most addons will probably become Jetpack addons, which is a model similar to Chrome's. That kind of addon is more limited in what it can do, but also unable to cause memory leaks. Aside from that, we are moving to a one process per tab model, also like Chrome, will will help narrow down which page is responsible for large amounts of memory being used, when that happens. In the short term, though, problems like yours are almost always caused by addons or plugins, and I apologize for the hassle, the best thing to do is to find which it is, as I said earlier.

I can turn off AdBlock but not Firebug, I'm in it all day and need it for development. It would be ironic to see a tool like Firebug be the cause of this problem. Firebug is also only running in a single tab, the app that I'm working on and that's it. So I'll play around with the addons but isn't there a way to see how much memory each addon is using instead going through a trial and error routine?

I just closed my browser and restarted it with the same 34 tabs and memory usage went down to 384 MB from 1.3 G

If you see memory usage change that quickly - 2MB per second! - then this should be easy to figure out. Disable Firebug for a few minutes and see if that fixes it. If not, then try closing page by page, until you see that the constant 2MB increases stops. Slowly disable and close stuff, until you are left with just a window with Slashdot and nothing else - no addons or plugins even. Then close Slashdot;) by browsing to about:blank. If you still get 2MB increases every second, that is bizarre.

Ok, so I've disabled all plugins and addons and restarted the browser. I sat and waited a couple of minutes before clicking on anything and until the memory usage stabilized and it did at around 615MB. As soon as I started to write this message, the memory usage started to climb. It's now at 695MB since I started writing this. As I type, the memory goes up, almost as if each keystroke is making it go up, it's now 737MB! Remember, no plugins and no addons. I'll stop typing now to see what happens. 750MB. (1

That sounds normal to me - going from 178MB to 223MB isn't unexpected. You probably have several pages cached, each taking a few MB. That, and things like the JS heap 'settle' on a slightly higher amount of RAM soon after load (and stay there), as they keep allocated pages held to not waste time reallocating them later. There is also some effect of memory fragmentation (which makes more memory appear to be allocated than has been).

An interesting comparison would be, to load those exact pages in Firefox a

If you prefer to change that behavior, it's easy to do - change browser.sessionhistory.max_total_viewers in about:config to 0. Then it won't cache pages. You will have slower loading of pages when you press back, restore recently closed tabs, etc., but if you would rather save that memory then that's cool.

In my personal experience, and also in surveys of Firefox users, the caching is almost always a good thing - it does not lead to any system slowdown, and does speed up the responsiveness of the browser.

The websites and behavior sound pretty normal to me. So I would suspect AdBlock (which is known to cause leaks in some cases, at least one issue is fixed in Firefox 4.0.1 IIRC), possibly also Flash. I would try disabling them both for a few days and see how that changes things. If the problem remains, I would try a new profile. If the problem still remains after that, then it should be reproducible at that point, maybe we can get more specific with the details (which sites, # of refreshes, etc.), and I'll t

If you see that, then you might have plugins or addons installed systemwide (for example, Skype installs such plugins, and many others). Please try to disable or uninstall all plugins and addons, they might cause such problems. For myself, I do those 3 steps you mention every day, both as a normal user of Firefox and as a developer. I have not seen anything similar. If I did, it would be my #1 priority bug to fix.

In any case, if you are pleased with Chrome, then I'm happy you found a browser that works f

I suspect that a profile can, in very rare cases, cause this. We save a lot of stuff in the profile, which is useful, but also complicated - there are likely some rare corner cases that hit a very small number of people.

It's simple to find out if this is your issue: Create a new profile, browse with that for a few days, see how it feels. Also worth doing is disabling addons and plugins in the new profile.

I hear this quite a bit, but isn't there a better way by now? Ditching one's profile is highly injurious for serious Internet users. I understand the short-term debugging value, but say a new profile fixes things. Then what?

After you close all those tabs, to a Ctrl+Shift+T (or a History | Recently Closed Tabs and restore your last closed tab). Notice that the entire page did not get re-loaded, as it was still cached in memory. Try this for a few more tabs, and you'll see where most of your RAM is going. That's also part of the reason that restarting the browser will help.

If this genuinely bothers you, change the value of browser.sessionstore.max_tabs_undo in about:config. The default is 10. If you can live with it (i.e., if yo

I'm using FF 4.0 and since the system is connected to an APC-UPS with 30+ mins runtime, I haven't shut it down for the last 17 days. Currently I'm using 28 tabs, Noscript, Down Them All and Better privacy and total memory footprint is a meager 420K according to Task Manager in Win7.