5 ms·
Ever wonder why your laptop fan turns on and you lose a half hour of battery life when you load up a tiny, blocky online video? It can't be because the video de
by cyrus_ 16y ago
Ever wonder why your laptop fan turns on and you lose a half hour of battery life when you load up a tiny, blocky online video? It can't be because the video decoder is written in a language like Actionscript because everyone says performance doesn't matter...
- andos 16y agoThat or your laptop is sitting on a fluffy mattress and is having a hard time dissipating heat. Just kidding, of course. If you're pointing at the poor performance of Flash Video on a Mac, I think the video decoder is written in C or C++, it was just... not really optimized: http://blogs.adobe.com/conversations/2010/02/open_access_to_content_and_app.html#comment-703 http://blogs.adobe.com/conversations/2010/02/open_access_to_...
- DarkShikari 16y agoFlash's video decoders are written in native code and pretty heavily assembly-optimized. They're not as fast as they could be, but they're nothing compared to something truly slow (e.g. reference decoders). The high CPU usage is typically because of two things: 1) Flash has to do extra compositing to add ads and such onto video. 2) Flash typically doesn't use hardware acceleration for the actual blitting -- their excuse is that on a significant % of computers, bad drivers will result in crashes, and they'd rather be somewhat slow on 100% of computers than crash 1% of them. If you want something to complain about, go after the sites using Cortado to decode video. Yet even that is still JIT'd, though completely lacking SIMD asm due to being Java. Disclaimer: I am not a developer of Flash, I just know one.
- cyrus_ 16y agoThanks for the info -- but my point stands, performance is important when you care about energy usage (mobile, laptop, server). Really the only place its not important is GUI programming and high-level application logic.
- andos 16y agoEven GUI programmers need to be aware of performance. Painting can be expensive, especially on mobile devices, and event handling must be swift or else the app will feel unresponsive.