Hacker News new | ask | show | jobs
by derefr 4664 days ago
> There probably aren't a lot of ways to peg the CPU at 100% for minutes on end in ChromeOS while not in dev-mode.

Load a webpage with just one or two screenshot-sized animated GIFs. Browsers are really bad at this; I wonder how many years it's been since the GIF rendering code was touched in most implementations.

1 comments

Interesting. On my phone pages loaded with animated GIFs are slow as molasses but on my regular ol' Linux (Core i7, Intel graphics) desktop I don't think I've been to a page where I experienced any sort of slowness.

For example, this page: http://imgur.com/a/Htgmq (Animals Staring, SFW)

That'll bring my Samsung Galaxy S4 (a very current quad-core phone) to a crawl but my desktop won't even get the chrome process above 10%. Maybe it's GPU-related? I wonder if Chrome for Android even uses the GPU, hmm...

Those aren't nearly big enough! See instead: http://rainbowdivider.com/, or better yet http://totallytransparent.tumblr.com/ (note that in the latter one only the animated images are GIFs)

But now, a trick, to make browsers even angrier (which is starting to come up as a use-case in, e.g., forum signatures and avatars):

1. set the GIF to a non-native scale (e.g. width="100" height="100");

2. apply a CSS animation to it, where the CSS animation loops a filter() value on the GIF. For example, filter: hue-rotate() the GIF through a 360 degree cycle every 2s. For maximum pain, apply a filter: blur(). (Warning: this last one may actually crash your browser, or at least cause severe artifacting on random parts of the page. I've been intending to report it to Chrome's bug-tracker for a while...)

I believe this causes as much havoc as it does, because GIFs are always decoded on the CPU, and the results of decoding GIF frames and scaling them to display size are never cached; instead, each time a GIF transitions to a new frame, it writes the frame-delta directly on top of the previous frame's video memory. So, when you apply a GPU-bound filter to a CPU-bound write-heavy texture, you give the GPU's pipeline a pessimal case.