Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or alternatively... Firefox fail was previously wasting gigabytes of memory on image-heavy pages


Gee, the trolls are up early today...


On one hand true, on the other - it isn't that those fixes are some magic, extra smart hackery (at least on the idea level, dunno about the implementation). Don't load an image that user don't see, remove an image that user saw but don't see anymore - those seem as rather obvious solutions.


Just determining whether or not the user can see an image is quite tricky when you consider that there are a number of things which could cause it to be invisible to the user and thus safe to remove:

* It might be placed as a normal block element on the page but out of the current viewport.

* It might have had visibility: hidden CSS statement applied to it.

* It might have had display: none CSS statement applied to it.

* It might have the alpha channel set to fully transparent and then fade in.

* It might be inside a <div> that has overflow: scroll and then have that specific div scrolled such that the image is outside the viewport of that <div>

* It might be using top and left CSS properties to animate the position of the element such that it is off the screen.

* It might have it's CSS width or height set to 0 so that it can be start out "hidden" and then have animate open.

So I wouldn't discount this as just a simple solution because I see a lot of edge cases where things could get confusing just due to the complexity of how many ways there are for a page element to be visible versus not visible.


Obvious, but tricky. Take a look at the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847223

It comes in ten parts, and there's lots of discussion about how to deal with viewports, when to load things in, etc.

The original bug (which discarded images that weren't visible) was even worse: https://bugzilla.mozilla.org/show_bug.cgi?id=689623


Yeah, and to cure cancer you just need to eliminate the bad cells without affecting the good cells. It's obvious.


Except, selectively targeting (bad) cells in a heavily complex system (physiology) that you didn't design and have limited access to makes it tough.

Implementing these fixes in FF is easy. They didn't even have to be geniuses to realize it, just keeping an eye on friends (/rivals) would have given them the idea a few years ago.

NB: Not criticizing FF devs. They do awesome work! And sometimes, such silly little optimizations can just stay hidden at the back of everyone's minds for ages until showing themselves through a veil of obviousness.

But, cancer vs these optimizations? No chance.


The idea of fixing them is easy, the practicalities are clearly not - take a look at the size of the bug reports and patches that go with them...


I agree it is tricky. But not as bad as curing cancer, by far.

Practically, cancer cannot be cured even by multiples of all the effort than went into those two bugs.


Stretching the analogy a bit too much? The crux of point was - simple ideas can become excruciatingly complex to impossible solutions in practice.


The great thing about Firefox is that if something is so obvious, you could also contribute to the development effort...


right on. Please spend as much time reading the bug referenced above as you have this thread, and think about the obvious problems/hard solutions proposed, then make a better one! Just keeping a few million WinXP machines from a recycling barge in Bangladesh for another year would be worth the trouble. and hopefully smarter image handling by everybody's browser/phone/whatever will be a long term result.


Yeah the original comment isn't all that wrong technically (though not very nice either). Firefox is my main browser but loading long and heavy pages takes noticeably longer than with Chrome or IE and causes laggy scrolling. Glad they fixed it with v26 though, hopefully should land in the beta channel soon.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: