News for hackers. Stuff that matters.
Re:HN: Please replace grayarrow.gif with Unicode character ▲ by nslater on Friday July 13, 2012 @05:07AM (#4238953)
Rendered once and cached? The cached GIF is rendered each time as well. As far as I know, it's not possible to cache a rendering. There are still calculations to do each time you want to convert the cached data into an image. The question then becomes, which calculations take longer. The calculations needed to convert the CSS into a bitmap for the screen, or the calculations needed to convert the GIF data into a bitmap for the screen. I'm betting the difference is negligible.

(If I have misunderstood some step of the rendering process, I would love to know how, or what. I don't know much about graphics processing, so I am unaware of any caches beyond what the browser maintains.)

Re:HN: Please replace grayarrow.gif with Unicode character ▲ by lucian1900 on Friday July 13, 2012 @06:51AM (#4239204)
Afaik, the browser will read GIF once and keep the bitmap in memory, then composite it into the right place when it needs it, which is a lot cheaper.

With SVG, the browser will render it once and keep a bitmap, then composite it.

With a CSS icon, there is no way for the browser to know that it's an icon at all. There is no clear delimitation between it and the rest of the page. The browser has no choice but to re-render it every single time.

Images or SVG are much better choices for icons than a bunch of CSS.

Re:HN: Please replace grayarrow.gif with Unicode character ▲ by jrmuizel on Friday July 13, 2012 @07:36AM (#4239321)
The rasterization of the Unicode character will be cached in the glyph cache just like the rest of the glyphs, so the GIF is not really any cheaper.
Re:HN: Please replace grayarrow.gif with Unicode character ▲ by lucian1900 on Friday July 13, 2012 @08:13AM (#4239446)
Ok, SVG, character and GIF are better than a bunch of CSS :)
Re:HN: Please replace grayarrow.gif with Unicode character ▲ by hei_zen on Friday July 13, 2012 @08:53AM (#4239582)
You misunderstood a lot of things. Most importantly that replacing a graphic with a unicode char has something to do with CSS :-)
Re:HN: Please replace grayarrow.gif with Unicode character ▲ by lucian1900 on Friday July 13, 2012 @09:29AM (#4239693)
My original comment is a reply to the suggestion to use a CSS icon.
Re:HN: Please replace grayarrow.gif with Unicode character ▲ by user-id on Friday July 13, 2012 @09:33AM (#4239711)
Well, using the :before or :after pseudo-selector and content property is a possibility.
Re:HN: Please replace grayarrow.gif with Unicode character ▲ by megablast on Friday July 13, 2012 @05:43AM (#4239055)
Of course there are way to cache renderings, this is the reasons firefox used to use so much memory, it would cache the uncompressed images. Why would you think that was not possible?