Hacker News new | past | comments | ask | show | jobs | submit login
Mozilla: Are We Slim Yet? (areweslimyet.com)
212 points by cpeterso on Apr 4, 2012 | hide | past | web | favorite | 98 comments



A nice manifestation of the idea "What we can measure we can fix."

See also: http://arewefastyet.com/


Also:

http://areweprettyyet.com/

https://wiki.mozilla.org/Platform/AreWeFunYet

http://areweplayingyet.org/ (from SoundCloud)

The irony (or maybe that's the point) of using this meme is that you'll never get to the end of the rainbow. A browser's work is never done.



They still have a way to go to hit "pretty." Sadly, it's a lot harder to measure than "fast" or "slim". I wish I had the language to describe why Safari's font rendering is so much better than Firefox's; it's "visually obvious", but I just don't have the vocabulary or expertise to analyze.


There are many articles about Safari's font rendering, here is one: http://www.joelonsoftware.com/items/2007/06/12.html I think it's more accurate to say that it's different, whether or not it is better seems to be a matter of preference and priorities.


I think the parent is talking about the difference in rendering between Firefox and Safari on OS X, not between Windows and OS X.


Yes, that was strictly on OS X. I would think that Firefox and Safari would be rendering fonts in the same way, but Safari somehow looks better.

I last compared only a few days ago. When I get back home, I can try again and see if I can get more analytic about what the difference is, but, as I said, part of the problem with this kind of aesthetic/design judgement is that I don't have the vocabulary to analyze it.


Here's a screenshot: http://i.imgur.com/eSZfc.png

The difference is more obvious in Cyrillic text on the bottom -- there's something wrong with hinting in Firefox.

And another one: http://i.imgur.com/op1bj.png


In Windows Safari, text still sees the anti-aliased rendering that its Mac brethren enjoy in all browsers. That's what the parent is referring to.


No, the issue has nothing to do with differences between Windows and OS X rendering. http://news.ycombinator.com/item?id=3798667


I'm a bit confused; on what basis can you possibly make this assumption?


I said (or tried to say) above that I was strictly talking about Firefox and Safari on OS X, not on Windows. Upon re-reading, it came out a little funny.


They've also been going backwards, with their missing favicon icon.

http://support.mozilla.org/en-US/questions/890741 http://techlogon.com/2011/11/16/website-icons-missing-after-... https://bugzilla.mozilla.org/show_bug.cgi?id=702730

If they don't get this fixed I don't have much hope for them making it pretty.


Our engineering team's motto is "if you measure it, it will improve".


The funny thing is that it's almost true by default. The mere fact of measuring something is often enough to drive improvements.

A couple of years ago, I installed the RunKeeper app on my phone and started tracking how long it took me to walk places. Over the course of a few months, my walking speed increased from a pokey 5 km/h (3mph) to 8 km/h (5 mph). I didn't install the app with the goal of walking faster; it just happened as a side-effect of regular feedback on how fast I was walking.


Same here, with eating. Simply writing down and calculating what I was eating ended up with me eating more (which I'm aiming for).

Now measure all the things?


Seems to be the idea behind http://quantifiedself.com (in case you haven't heard of it before).



My understanding of the Hawthorne effect is that it is a temporary increase in performance due to the subject's awareness of being studied. I stopped using RunKeeper over a year ago but my default walking speed has remained much higher than it was when I started measuring it.


Except the Hawthorne effect is poorly studied, probably doesn't exist as its own effect, and is useful only as a metaphor for this very "What we measure we can fix" effect.


Which is true.

You do, however, have to be very careful that the "it" that is being improved is really the same as the "it" that's being measured. I've lost count of the times that I've seen a well intended metric end up driving exactly the wrong sort of behaviour.

(For example: I recently sat through an excellent lunch time rant from somebody whose boss is prioritising shorter simple-to-implement stories over longer ones with a higher business value, because their team is having their efficiency judged by the cycle time (length of time between story-in and story-out)).


Just in case you haven't already read the lesswrong essay on optimization by proxy:

http://lesswrong.com/lw/28r/is_google_paperclipping_the_web_...


The corrolary would be "Think twice about what you want to measure"


(Mostly) full list of all of them: http://arewemetayet.com/


I used to have loads of problems with Firefox, it was so slow... took several minutes to close, it would freeze regularly etc. I got so sick of having to clear the cache every few weeks.

Then one day I noticed their hidden profile manager, created a new profile and used it instead. A few months on and everything is still working like it should. No need to clear caches, it quits within seconds, no crashes and so on.

It's worth a try if you get something similar. Obviously something was screwed up with my profiles, it took a really long time to delete the old profile.


Vacuuming your Firefox profile's SQLite databases can significantly improve startup time:

http://mozillalinks.org/2009/07/vacuum-your-firefox-database...

There was a bug request to auto-vacuum profiles after an upgrade, but the bug was closed as WONTFIX:

https://bugzilla.mozilla.org/show_bug.cgi?id=395020


If you read that bug, it was WONTFIX'd because they chose a different way of scheduling vacuums.


Yep, I used to have a few problems with my addons. Various windows would stop appearing or only partially appear, tree-style-tabs would have funny behaviour. I would assume it was because I was running the latest FF and the add-on hadn't caught up yet...

However, simply creating a new profile solved all my problems. Now, any time I run into an issue, I just create a new profile.

I know some people will simply suggest switching browser, but nothing handles hundreds or thousands of tabs better than firefox, and I'm not looking to change how I browse the web just to go easy on my browser...!


A corrupted sqlite database file could do that.


I shudder to think how much of the Firefox's reputation for slowness comes from busted profiles :(


Yet another a paragon of communications transparency from Mozilla. Here's what we're trying to do (https://areweslimyet.com/faq.htm). Here's the data (https://areweslimyet.com/). Here's how you can get involved (https://github.com/Nephyrin/MozAreWeSlimYet).


I'll admit that I was expecting a site more like http://hasthelhcdestroyedtheearth.com.

It's really nice to see that Mozilla is still taking this stuff into consideration. After all, memory has been a point of contention in the community since Firefox 3 or so.

I know the FF detractors are going to come out of the woodwork at any moment, but I feel that reports of Mozilla's death have been greatly exaggerated.


Read this last night, agreed. Only now noticed the username :)

Do you use it as your fulltime browser? Why is it better than Webkit-powered alternatives?


I'm just hoping slimming down memory usage won't go at the expense of speed... my systems have 16GB of RAM - I want Firefox to use as much memory as possible to speed up my experience. So if slimming down FF will make my disk trash more, that's the wrong direction to take.


> So if slimming down FF will make my disk trash more, > that's the wrong direction to take.

We explicitly don't want to cause this.

When we reduce the number of nodes in the live object graph, our garbage collector and cycle collector run faster. This results in shorter stop-the-world pauses when we collect.

This isn't the only thing we've done as part of MemShrink, of course, but it's an example of how reducing memory usage and running faster aren't always at odds with each other.


I'll repost nnethercote's article on the consequences of memory reductions, it's a classic: https://blog.mozilla.com/nnethercote/2012/02/08/the-benefits...


Yes, one thing I notice is that when I have a tab with a lot of images in it, and I switch to another tab, browse a little and switch back, I have to wait for the images to 'reload'. I guess it stores them compressed in memory and they have to be decompressed again. I have memory to spare and sometimes it does this when I'm quickly switching tabs for comparing something for example. This is annoying.

I'm also one of those users that leaves 100's of tabs open in the background, and sometimes I think they, or javascript (userscripts?) in them keep using CPU somehow, and it slows down everything. It would be cool if firefox could set a low CPU priority to these tabs, or freeze them if possible, ala BarTab extension.


On Linux at least, the rest of your RAM will be used by the page cache which does a lot to make disk access efficient, and as much as possible bypassed entirely.


Yep. In other words, using more memory in user space is a sure way of slowding down the system. Specifically PostgreSQL is easily impacted by that as it keeps as little memory for itself as possible and delegates everything it can to the OS.


From https://wiki.mozilla.org/Performance/MemShrink: "Changes that reduce memory consumption but make Firefox slower are not desirable."


In an age when most computers come with 4+ GB of RAM, I think people focus too much on memory. Of course there are older computers, but their OS should be using comparably less RAM. WinXP takes up 100 MB at login, so if you only have 1 GB on an older computer, you should still have no problem running modern Firefox. And if you only have 512 MB, it's probably time to upgrade since the web experience that a modern browser can offer you will be crippled by your old hardware.

A few months ago I had a conversation with somebody who complained that Firefox used too much memory (about 600 MB). I asked how much he had. He said 3 GB. That seemed more than enough to me, after all Gnome consumes 200-500 MB at login, depending on whether you're using 32 or 64 bit and which shell you're running (Gnome 2, Gnome Shell, Unity, etc). Turns out, Win7 was eating 2 GB at login, leaving him with only a gigabyte for other programs.

In my view, the operating system is just a platform to launch other stuff. It shouldn't use more than 25% of your memory. If it does, you should either get more RAM or slim down your OS. If his computer obeyed my rubric, he'd have plenty of room for Firefox. His anger was obviously directed at the wrong problem, but for some reason the OS (and all the crapware which loads at boot and runs in the background, even when it's not needed, consuming precious resources) gets a pass.


But why do our computers have to come with 4GB+ of RAM, when 1GB might suffice? It's an circular argument to claim that it's OK to use lots of RAM simply because the computer comes with lots of RAM.

After a manufacturer begrudgingly provides the RAM that developers refuse to conserve, we shouldn't then use the presence of this additional RAM to use even more.

Your friend's anger at application waste is justified. Witness new devices like the iPad that survive with much less RAM than a desktop -- just 512MB, which happens to be enough to support an excellent browser.


Are you kidding about the iPad? It definitely suffers from lack of RAM. Almost every time you change tabs, it has to reload the page.


We use that memory because we do more things faster. Of course we could page to disk whenever we want to use more than 1GB of memory, or render from CPU instead of keeping uncompressed versions in memory to lower footprint... Or we could have faster computers. Consumers prefer the faster computer option.


Sure, using more RAM to make things faster is a fine thing. But I think you give developers too much credit: many apps use lots of RAM for no other reason than lack of care.

Which of course can also be to the benefit of consumers: better a RAM-hogging release today than a memory-efficient release next month (if ever).


Memory consumption is important because it has a significant effect on performance and crash rate. The effects vary greatly depending on your hardware. You're right that people focus too much on raw memory measurements themselves. There are many time/space trade-offs.


I don't think Win7 alone can account for 2 GB at login, even with SuperFetch.

There were probably a few programs that run on startup (antivirus, IM, OEM-specific crapware if it's a laptop, "speed launchers" like adobe reader, updaters)


I installed a new Win7 partition last week. Yep, almost exactly 2GB memory usage at start. This was a clean Win7 Pro, no third-party crapware installed.



Not yet, but getting there.

Also the bazillion extension that exist for Firefox are not really helping.

A "task manager" to be able to keep on eye on all extensions memory consumption (and be able to kill the extension from the browser) should really be helpful.


Try about:memory, it's pretty good.


Yeah, it's not really great either. The about:memory page in Firefox is a little bit too technical compared with the about:memory in chrome that is, at least, simple and easy to understand what is going on.

In Firefox I still see a lot of memory commited to tabs that I've closed long ago, and can't really get a breakdown of my extensions memory usage.

Also what I was wishing is something more like a os task manager. Where I could kill or restart extensions that are using too much memory like I can do to normal applications.

Simply stating that this extensions is using too much memory so don't use it (a la IE) won't help. If that extension is the main reason I'm using your browser I'm not going to turn it off.

I'm not saying it would be easy or even doable right now, it's just what I wish to see in a future web browser to keep the memory down and prevent me from killing it and restarting it twice a day while working.


about:memory is intended to be a tool for developers and highly technical users. But we're getting close to the point where per-tab memory reporting will be feasible, see https://bugzilla.mozilla.org/show_bug.cgi?id=687724, which is currently blocked on some other infrastructure changes.

Once that's in place, we can slap a friendlier UI on top, something more like the about:nosy add-on (http://www.visophyte.org/blog/2012/02/04/aboutnosy-is-aboutm...).

If you're seeing memory for tabs you closed a long time ago, we'd love to hear about it. https://developer.mozilla.org/en/Zombie_Compartments#Reactiv... has documentation on how to check for these cases.

As for measuring memory consumption of extensions, you're about the 1000th person to suggest it :/ New-style ("JetPack") extensions have some tracking, but old-style ("XUL overlay") extensions are really hard to measure, unfortunately.

If a critical extension is using too much memory, one option that might be suitable is to create a separate profile. E.g. Firebug leaks a lot (https://bugzilla.mozilla.org/show_bug.cgi?id=669730) and some people only need to run it occasionally. Depends on how often you use the extension, of course.


I think the point of about:memory in Firefox is not to a task manager, but to allow the developers to know what is going on. If I report a high memory issue, I can copy/paste about:memory into the bug.

Now, on the other hand, I have been wanting a real task manager in browsers for years. It was one of the first things that got me excited about Chrome.


I have around ~30 tabs open for a total 900mb of memory and it says Javascript is 55% of that. That is crazy.


This is exactly the type of thing the Firefox team needs to do.

Measuring memory usage causes engineers to focus on it.

Making the data available piques the curiosity of geeks who historically drive change (in a "you should use this browser" way).

Having a few charts comparing with other browsers (chrome in particular) would be a good idea too, especially once they start beating chrome (if ever obviously).


I'm glad they are working on that. Right now I'm not using Firefox because after a day or so typing into a text box starts to stall. I'm not sure it has to do with memory usage, but it has been that way for years on my Mac. Not on Windows or Linux interestingly.


I do wish there was a good browser I could keep open for weeks and not have to worry about how much memory its using at the end of it. Even on Chrome, using it without closing it for a few days runs me into a lot of memory used. I know a bit of this is used for keeping the history so you can go back or undo closed tabs, but I wish there was a way to make it forget that without closing it (maybe there is?)


Trying blocking Flash by default. I leave my Chrome windows open for long periods of time. After a while, the memory consumption would get out of control. I finally realized that it was Flash that was causing the problem. There are many Flash blockers out there (you can right-click to enable it on-demand as you need it or use a whitelist) and newer builds of Chrome have built-in support for blocking.


If it happens after a day or so, memory is certainly a factor.

Also, https://bugzil.la/695693 might be relevant, one of the comments explains how to diagnose if this is a reflow bug.


Is it the same old fallacy that consumed memory is somehow bad? What if they use it for efficient caching?


Trade-offs exist! How astonishing.

From https://wiki.mozilla.org/Performance/MemShrink:

"MemShrink is a project that aims to reduce Firefox's memory consumption. There are three potential benefits.

1. Speed. Firefox will be faster due to less cache pressure, less paging, and fewer/smaller GC and CC pauses. Changes that reduce memory consumption but make Firefox slower are not desirable.

2. Stability. Firefox will suffer fewer aborts/crashes due to virtual or physical memory exhaustion. The former is mostly a problem on 32-bit Windows builds with a 2GB or 4GB virtual memory limit, the latter is mostly a problem on mobile devices that lack swap space.

3. Reputation. Fewer people will complain that Firefox is a memory hog and that Mozilla ignores memory usage."


I am not a specialist on that stuff, but I note the "will". If they have launched and noticed actual improvements, I'll be interested.


nnethercote on the other hand is the "specialist" as he is in charge of the MemShrink project itself... I would trust him on this stuff.


OK, but the developers of Mozilla are specialists, too. Why not trust them? Or is nnethercote part of the Mozilla dev team? MemShrink will hopefully just be merged into the core?


He's part of the Mozilla dev team. Memshrink isn't a branch that's waiting to get merged, but an ongoing program to reduce overall memory usage.


I'm a Mozilla employee and started MemShrink. I also write about it regularly: http://blog.mozilla.com/nnethercote/category/memshrink/.

MemShrink has been running since June 2011 and there have been many improvements in Firefox's memory consumption since then; these have shown up in Firefox 7, 8, 9, 10 and 11.


I have already found one case in Firefox where this is true. FF will load the image data in background tabs, but it won't decode it (e.g. render a JPG) until you switch to that tab. I may be nitpicking but the extra half-second or so bothers me like texture pop-in in a game. So I go to about:config and set image.mem.decodeondraw and image.mem.discardable to false.


By now I think it's well-known to every Firefox user that in the case of Firefox, the memory used is mostly leakage.


Yes, absolutely. These measurements in the linked article are just a complete and utter lie.

Edit: The sentence above is sarcastic. Firefox has had better memory usage than its competitors for a while now, despite the belief that it is leaky.


Evidence, please.


I'm glad they are doing this because they need to do something about memory usage, but there are some problems with this approach. -websites change over time. If a site gets redesigned, it'll throw off test results unless they're rerunning the tests on old builds too -this still doesn't capture how users actually use browsers so could miss some serious leaks. What about clicking around on the same site, opening links from the same site in multiple tabs, leaving a tab open for a week, etc?

Additionally, they keep saying that extensions are a huge source of leaks. I feel their pain because they don't have that much control over them, but they need to come up with some sort of a solution to deal with it, because let's face it, who's going to run FFx without any extensions?


Their FAQ [1] states that they were fetched last year and stored locally for testing. So changing sites shouldn't affect the result. I presume they will switch the set of sites in a few years, statistics don't need to be over 10 years to be useful.

[1] https://wiki.mozilla.org/Buildbot/Talos#tp5


Hm, they stated that the gaps in the graphs were due to failures collecting the data for that release. To me that implied that they weren't rerunning the test on each version every time.


nethercote discuss their actions about extensions memory leaks

http://blog.mozilla.com/nnethercote/

he also published some notes about the history of memory analysis in firefox http://blog.mozilla.com/nnethercote/2012/01/17/notes-on-redu...

pdf direct download : https://wiki.mozilla.org/images/9/93/LCA2012.pdf


Extensions should be given an aggressive memory limitation to work with, and a profiler should be made so that extension developers can see what they're using and where it's spent.

Constraints are good things.


Even if a per-extension memory limit was possible, good luck choosing the actual limit and then surviving the storm of "WTF did Firefox kill my extension?" complaints.


For various reasons this cannot be done for most traditional extensions that introduce advanced functionality (e.g. AdBlock Plus), since they can override the browser's functionality without limitation. Add-on SDK extensions are another matter but those are comparatively very limited in what they can do.


This can be fixed with a split model. Chromium sometimes introduces fairly ad-hoc APIs (there was one to hook into HTTP requests, first declaratively which was discontinued, then with JS-side filtering which seems to be used by the ABP port); Jetpack add-ons can also use custom modules that hook into the full Firefox API. That way, the part that needs care and auditing for memory/lifetime issues can remain small.

https://addons.mozilla.org/en-US/developers/docs/sdk/latest/...



They are measuring and trying to fix the wrong things. I don't care if you think you are 'lean'.

The problem is that you have some stubborn devs or decisions that were made a long time ago that need to be reversed but for whatever reason are not being reversed or are hard to change.

What I care about is perceived start up time and perceived overall performance.

For perceived start up time to improve they have to stop doing some things that they normally wait to finish doing before showing the screen. Like waiting for all of the tabs to load, checking for updates to add-ons, etc.

For overall performance to improve I think they need an extra performance mode that will restrict what Addons can do.


There's a fix for one of those. Preferences -> General -> Don't load tabs until selected


Maybe Mozilla should consider creating arewetolerantyet.com in the light of Brendan Eich's donations to questionable political campaigns.

SCNR ;)


Nowhere on the page does it say what TP5 stands for. Google has also been unhelpful? Can someone explain?


As I recall, T stands for Talos, which is the name of the Mozilla performance suite. TP5 is the 5th version of one particular benchmark which takes pages from the "current" eb (hence the need for new versions every few years). I guess 'P' is for performance, but I forget.



Actually, even that just used the Acronym without explanation. I missed the link in the 'answer though'. So 'after TP5' means after loading a manually curated list based on the top 500 web pages? Huh, in that case I'm impressed with how Firefox has improved.


Yeah, I don't know what the "P" in "TP" stands for. Maybe "pageset". "T" is for "Talos". It's version 5. Or at least, the previous one was TP4 -- I don't know if there was a TP3. :)

> So 'after TP5' means after loading a manually curated list based on the top 500 web pages?

Yes. TP5 is a list of 100 pages (based on Alexa 500, I believe, but I'm not sure), and we load the pages 5 times in 30 tabs.


[deleted]


What? People are complaining all the time that programmers become lazier and lazier and make programs more and more bloated as time goes on. Writing efficient programs requires complex tricks. I can't believe someone's complaining about that now.


"Writing efficient programs requires complex tricks."

Says who?


I think it's more accurate to say that writing efficient program requires some modicum of thought, foresight, or planning.

In a rush to put in new features for the past few years they've become the new Winamp of web browsers, stealing the crown from IE. In fact, I think from now on I'm going to refer to mozilla as winamp - until they fix their problems.

I'm sensitive to the challenges facing modern browsers. But this bloat isn't (in my opinion) caused by new requirements and features; it's caused by the same type of thinking that allows a dev team to think that it's OK to write programs that require multiple gigabytes of RAM to link. It should come as no surprise that the result is a program that steals half a gig of private space to display a couple static pages.


What problems? Memory consumption has been trending downwards for over a year now. Have you tried Firefox lately?

As for the linking issue, that's a shortcoming in MSVC. Chrome hit the same issue earlier than Firefox did, and switched to a 64-bit linker as a result. Web browsers contain enormous amounts of code because they support enormous amounts of functionality. The code size has only a moderate bearing on the amount of memory consumed at runtime.

If you're seeing Firefox using half a GB to display a couple of static pages something is wrong. Likely causes are a busted profile or leaky add-ons.


It still takes a gig-plus with the usual linux toolchain (also, it takes HOURS, now). It's not just an issue with MSVC link.exe, even if the linux toolset hasn't hit the critical point yet that MSVC has. The point is that other programs manage to link without this sort of absurdity. Why the hell can't winamp? (making good on my promise, firefox is now winamp)

As for busted profiles and add-ons, I don't know what to say to that that's not blatantly offensive, so I'll just offend. Winamp is a fat, ugly, smelly cow. It didn't used to be. Either the web is now a pig-farm, and everybody is writing javascriptish-do-nothing-scripts that allocate hundreds of megs without purpose (in which case, winamp needs to take a leadership role in fixing the javascript problem), or winamp has other serious issues it needs to address.

Either way, it's not my problem. Winamp devs can deal with that stuff.


Not really.


"Do i look fat?" It's a trap! If we say 'No' then the bloat continues. And if we say 'Yes you're fat' she runs away crying. And the bloat still continues.

Honestly, Yes. You're still fat. But some progress has been made. Keep going. Stop when you hear the first complaint about too skinny.


You mean, like "my systems have 16GB of RAM - I want Firefox to use as much memory as possible to speed up my experience."?


Given the choice between being forced to restart my browser because it's memory use is approaching the 4GB limit of a standard 32bit process rendering it unusable, despite my having several GB free; and it being able to remain stable by expanding past 4GB I'll take the extra memory usage.

Improving memory usage so that my browser never approaches the 4gb point in the first place would be ideal; but based on my personal history I strongly expect that any such gains will continue be eaten by increasingly heavy use on my part and those of sites I visit.


That quote is one of the dumbest things I've ever read on this site.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: