News for hackers. Stuff that matters.
Re:Firefox fixes save gigabytes of memory on image-heavy pages by anentropic on Tuesday October 01, 2013 @06:48AM (#6475277)
Or alternatively... Firefox fail was previously wasting gigabytes of memory on image-heavy pages
Re:Firefox fixes save gigabytes of memory on image-heavy pages by 01Michael10 on Tuesday October 01, 2013 @06:57AM (#6475313)
Gee, the trolls are up early today...
Re:Firefox fixes save gigabytes of memory on image-heavy pages by morkbot on Tuesday October 01, 2013 @07:13AM (#6475367)
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.
Re:Firefox fixes save gigabytes of memory on image-heavy pages by NathanKP on Tuesday October 01, 2013 @09:05AM (#6475801)
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.

Re:Firefox fixes save gigabytes of memory on image-heavy pages by AndrewDucker on Tuesday October 01, 2013 @07:31AM (#6475428)
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

Re:Firefox fixes save gigabytes of memory on image-heavy pages by icebraining on Tuesday October 01, 2013 @07:18AM (#6475386)
Yeah, and to cure cancer you just need to eliminate the bad cells without affecting the good cells. It's obvious.
Re:Firefox fixes save gigabytes of memory on image-heavy pages by pritambaral on Tuesday October 01, 2013 @07:36AM (#6475445)
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.

Re:Firefox fixes save gigabytes of memory on image-heavy pages by AndrewDucker on Tuesday October 01, 2013 @07:43AM (#6475464)
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...
Re:Firefox fixes save gigabytes of memory on image-heavy pages by pritambaral on Tuesday October 01, 2013 @08:50AM (#6475731)
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.

Re:Firefox fixes save gigabytes of memory on image-heavy pages by Ygg2 on Tuesday October 01, 2013 @09:35AM (#6475979)
Stretching the analogy a bit too much? The crux of point was - simple ideas can become excruciatingly complex to impossible solutions in practice.
Re:Firefox fixes save gigabytes of memory on image-heavy pages by kamjam on Tuesday October 01, 2013 @09:30AM (#6475941)
The great thing about Firefox is that if something is so obvious, you could also contribute to the development effort...
Re:Firefox fixes save gigabytes of memory on image-heavy pages by billiam on Tuesday October 01, 2013 @01:44PM (#6477753)
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.
Re:Firefox fixes save gigabytes of memory on image-heavy pages by Livven on Tuesday October 01, 2013 @07:35AM (#6475444)
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.