The reason that people are hammering at Flash so much is that there's one implementation of Flash and, for years, Adobe and Macromedia actively tried to stifle alternative implementations. Why does this matter? Over time, when there's competition between implementations, they all tend to get worked on and improve. Look at Apple's JavaScriptCore and Google's V8. Heck, even Firefox has improved JavaScript performance a lot compared to previous versions and Internet Explorer. The competition is so important that Microsoft has put a lot of effort into IE9 making JavaScript a lot faster there.
Right now, most implementations of HTML5, Canvas, and SVG aren't so fast. I've seen demos that show them getting fewer frames per second than Flash for animations. But the point is that they're open technologies whose implementations can and will improve. Flash has been a closed technology for so long and Adobe has taken that lack of competition and ignored performance concerns.
With video, it's the same situation. While browsers might not be using less CPU right now playing H.264, there's the potential for better decoding in the future. VLC uses very little resources on my Mac decoding H.264 video. It's not merely Safari's access to hardware acceleration since VLC doesn't use hardware acceleration.
The problem with Flash is that it doesn't allow companies like Apple, Mozilla, Google, and even Microsoft the opportunity to increase efficiency; it doesn't allow an army of volunteers to improve a code base. It's just stagnated since there was no other way to do animation and vector graphics until recently.
The problem with Flash isn't where it is now in comparison to other techniques. The problem with Flash is that the other techniques are open and improving at a rapid pace while Flash isn't. The problem with Flash is that open technologies have lots of smart people working to improve them and make their implementations better while Flash is remaining much the same.
Our objection to Flash is that we can see what happened with JavaScript and Ajax (from apps like Google Maps and Gmail to toolkits like jQuery and Prototype) happening with vector images, animation, and video if there's an open standard that all companies and individuals can freely implement and use; with Flash, all we can see is Adobe continuing to feed us the same product we've had for years.
Flash is not "remaining the same". Vast improvement has been done both in terms of features and performance in the past years -- many of them, yes, requested by the community - but I guess anyone who's not working closely with the technology won't be able to see it.
There's a lot of future predictions in your post. It's funny that people are changing their assumption that HTML5 us faster to that it will be faster eventually. Let's see how well this pans out. In the meantime, Flash will continue to evolve.
Since the Flash 9 release in 2006 that came with AS3 there were only minor improvements. So the rapid development of the previous years did not last. The past did not predict the future.
The new 3D API is maybe a 30% improvement in performance, it's mostly an improvement in swf size. Typed arrays rarely help. PixelBender looks like an early implementation, not a well supported feature. Alchemy isn't officially supported either, but it does some tasks well.
These hacky features took years to appear, so Flash isn't evolving any faster than browsers at this point.
Can you imagine if Netscape had managed to stifle free alternative implementations (not simply alternatives; free alternatives). I don't think anyone could refute the idea that the world would be a much better place right now if Microsoft hadn't crushed the market for web browsers and let it lay fallow for six years. (I'm not a Microsoft hater, but no changes to one of the most important pieces of technology in the history of humanity for years? Fuck everything about that!)
Macromedia/Adobe's closed nature should be looked upon as a strategic necessity. (I'm aware of the fact that the SWF file specification is open, and that Adobe has made significant contributions to OS JS [I've personally downloaded and browsed their SpiderMonkey engine]. I feel it's likely that they could have possibly held back key implementation details to prevent Microsoft or another party from creating their own version of the Flash player. I don't know if anyone outside Adobe could say for sure how earnest they are about openness in the player.) Openness is a great thing, and crucially important -- I believe our future depends on it. I also believe there's room for some non-threatening technologies that are unencumbered by standards bodies who can innovate quickly. Maybe Flash Player is the guy that quietly amasses a ton of pieces on Kamchatka, convincing everyone they're incapable of taking over the world, and then blam -- blows everyone else away. But I really doubt it. Let's not forget that Safari's implementation of Canvas was met with nerd-rage because it hotdogged around SVG. One party making something fucking awesome and then other parties adopting it is how progress gets made.
In relative terms, if we're comparing apples to oranges, Flash pushed innovation far more quickly than the browsers have thus far. It might feel like no time at all that we've gotten <canvas>, <video>, and <audio> all rolled out, but it has ( http://en.wikipedia.org/wiki/Canvas_element ), and they're still only partially implemented. Between the time IE6 rolled out in 2001, and IE7 rolled out in 2006, Flash added the following features: proper video (<video>), unicode support, pre-coded UI components, a vector drawing API (<canvas>), a second version of ActionScript, advanced typography (including custom fonts [@font]), filters, blend modes (damn -- not until HTML6), bitmap caching, sockets, alpha transparency in video, a third version of ActionScript, two giant/comprehensive code libraries, and many, many more features.
It's probably not fair to say that Adobe ignored performance concerns. There's been steady improvements to Flash performance, and the shit that sets your processor on fire is usually due to an over-ambitious developer without enough optimization experience. I can guarantee you that you'll see the same kind of performance Hindenburgs with <canvas> if you haven't already ( see article... ). They're a gigantic company with a ton of money, so doubtless they could have done more. You raise an excellent point about VLC decoding H.264 without thrashing.
Not sure what's the gist of the test -- all this proves is that it's possible to achieve 100% CPU usage in HTML, and that some browsers perform better than others. How does that relate to Flash?
I guess my point is that it's missing some real benchmark. So here's some.
If you are interested in a more direct comparison of performance between various multimedia technologies, then check out the tests done at themaninblue.com [http://themaninblue.com/writing/perspective/2010/03/22/]. This is one specific test but it shows that if anything, Flash performance is on par (if not better in some cases) with comparable technologies.
and
Re: what does this have to do with Flash?
So, when looking at Flash CPU usage compared to other multimedia technologies, then no, Flash does not use an inordinate amount of CPU. While Flash content can at times use high amounts of CPU, this is a result of the nature of the content, and not necessarily specific to the Flash runtime.
Edited with some original content: I think he has a good point that there's a lot of blind anti-Flash rage without actually thinking about what Flash competes with. Yes it's better to design websites so they don't tax your processor, but we're probably going to see the same issues people peg Flash with when sites use open alternatives for multimedia.
A product that has been actively developed for over 14 years had sure as hell better be able to say something more than "our performance is on par with" an emerging technology that is still being developed and isn't even standardized yet.
So, does that mean that you are implying that the irreducible complexity of tasks which were non-taxing to 15 year old computers in the early cd-rom "multimedia" era (e.g. various 2d animations and interactivity and video) in some way fundamentally require 100% CPU usage on modern multi-core multi-gigahertz processors?
Yes, it is. Any kind of non-hardware-accelerated video playback will be CPU-intensive. The MAIN point is that Flash is MORE CPU-intensive for a given frame-rate, color depth, and resolution than comparable codecs.
Comparing open, fresh-off-the-vine, HTML5 animations to a decade-old proprietary implementation like Flash is also a non-starter.
On the plus side, Flash videos currently make great, handy fan-speed servo tests for any Mac laptop.
Or rather, it WILL use them soon. Mac HW acceleration isn't fully deployed yet, is it?
It seemed to me like the article is, "Well yes there are these problem areas but there is an alpha that fixes them, so the entirely line of criticism is bunk." Obviously I do not agree.
It's good that Flash is finally getting comparable video playback performance. It's bad it took this long. And I also question why most people care. Flash, no flash... all I care about is video. If Flash is an impediment, let's dump it. Does that make a few Flash developers sad? TOO FUCKING BAD. This is an industry where change is a constant, if you wed your career to a technology you've made a fatal mistake.
"Or rather, it WILL use them soon. Mac HW acceleration isn't fully deployed yet, is it?"
Hence where available. And it wasn't available on the mac because Apple hadn't opened up the APIs to do it.
Your summary of the article is pretty poor -- that was one statement, the majority of the article was about the fact that critics often cite Flash as a CPU hog when comparing it to things that by default are not CPU hogs (static html).
Second, if video was the only thing Flash did, it would already be dumped. Flash does a lot more than that. The reason video is the linchpin is that it's taken innumerable years for standardized video access, whereas Flash provided it cross-platform. Sure you complain about Flash now, but the web wouldn't be where it is now without it.
VMWare and Parallels do very different things than Flash does. My (uninformed) guess would be that it has to do with the security sandbox. The kinds of things you would run on VMWare (installable applications) is very different than what you typically run in Flash (whatever random dreck you happened to stumble into on the internet :P).
It's much easier to do hardware accelerated 3d drawing with a toolkit for an interpreter than it is to make a full virtualization layer properly do hardware acceleration.
Your opinion is indeed uninformed. Fortunately for you, correction is easy to get on the internet.
No. You misunderstood my verbiage. Rather, that Adobe has had more than decade to refine their algorithms and data structures so asking comparable performance from, ahem, far less than a decade's worth of engineering development is rather short-sided.
HTML5 etc. isn't starting from scratch -- the idea that Adobe has had extra years to refine their algorithms compared to potential competitors is pretty nonsensical,
In response to B, how about Adobe's own Shockwave? O3D is another. Java unfortunately requires external libraries (and thus there's a security prompt), but they could easily integrate them.
I think the lack of another cross platform framework speaks more to the futility of trying to build market share with a plug in rather than any technical reason.
Futility? The whole issue with Flash right now is that they do have market share, because they're the only one in the market. Either something has Flash (desktops, possibly Android), or it doesn't. And the non-Flash platforms are currently missing out on a significant portion of web content. So the idea that browser plugin as a 'futile' way of building market share seems like nonsense to me.
What I'm saying is that building a competing platform (with, for example, 3d acceleration) is futile not for technical reasons, but because you've got the mother of all chicken and egg problems trying to convince both end users and developers to use the platform.
O3D was already superior to Flash for making games, with I'm assuming less than 10 man years invested. Haxe is a superior compiler to Adobe's command line mxmlc, and it's written by one guy. If gaining traction wasn't so hard, I'm certain Flash would be in serious trouble (the Flash IDE being the only thing saving it).
OpenGL isn't really in the same class as Flash for this context -- we're not talking about Flash just as a method of rendering graphics, but as a content/application framework that can also render graphics. If OpenGL did the other stuff Flash does, we wouldn't be in this situation to begin with.
Flash as a CPU hog is a user complaint. Users do not care how it compares to other similar technologies and this narrow metric won’t convince any of them. This was a fixable problem that wasn’t fixed.
Flash is no longer the king of easy to make visual extravaganza. It was apparent to those who used Flash because they couldn’t pile on extravaganza effects like they saw in Processing. Flash did not even address their concerns for years, if they listened to core users the performance complains from the rest of the web would have resolved themselves.
Flash should have had hardware acceleration added years ago (not just for video) because it was commonly used to display very taxing animations. Multiple out of view banner ads were a common use case, Flash had no built in ability to disable out of view banners that did not need to run, or API to enable background tasks that needed to be run. Most banners were made with AS2 and Flash still does not have an auto updating mechanism apart from Chrome.
HTML5 Canvas will get hardware acceleration eventually, WebGL will have it from the start. The difference is Flash was around for years doing those things, shoving ever more taxing animations while ignoring usage scenarios and the economics of Flash projects. (where developers satisfy clients, not users)
I expect browsers will pay more attention to usage scenarios, since they make their money when people use the web, Adobe makes it from selling tools.
tl;dr – If Flash or Canvas feel like CPU hogs that needs to be fixed, whatever it takes. Put in CPU usage limits, don’t let people compile CPU hogs, APIs for background tasks, add 20MB of hardware acceleration to the runtime, contribute to WebKit, Firefox, NativeClient to get it resolved. Should have prioritized this earlier, now kiss your penetration goodbye.
The reason people perceive Flash as a CPU "hog" is because there are a lot of script kiddy flash programmers out there that will write the equivalent of an infinite loop in their banner add. I've been in the trenches and seen some of the horrible ActionScript code. The same thing can happen with bad javascript. Flash GUI tools tend to attract non-programmers so they can make pretty stuff. Too bad it does not tell them that they have just created something that will crash everyone else's browser.
Maybe if Flash's run time encapsulated the Flash instances and made them behave, this would not be an issue.
Part of the problem with flash is that when it is crunching away executing some code, it is unresponsive to GUI events. One way around this is to break up computation by using a chain of events to complete the computation which allows GUI events to be interleaved thus making the application more responsive.
I think the main point is that for video flash is more taxing than a hardware decoded html5/x264 (at least on the mac because flash video doesn't use hardware decoding).
Except that it's also much, much more taxing on the Mac than other non-hardware decoding players. What seems seldom noted in this discussion is that the only OS X video player that supports hardware decoding is Quicktime X. Anything else—earlier versions of quicktime, VLC, MPlayer—uses software decoding. Despite this fact, those three options place half or less CPU load on my MacBook's processors than flash video does. As a quick test, a 720p h264 video running in VLC (software decoding) uses 35-50% of a CPU. 720p youtube using Flash 10.1's new hardware decoding support, uses >100%. That's simply unacceptable for fundamentally doing the same thing.
Flash performance on the Mac is terrible and hardware decoding is a red herring. I think a lot of those defending Flash's performance use Windows, where performance is much better.
The only thing that article convinced me of was that Flash is not a good solution for playing streaming video, because it has other priorities and must make concessions to those. But isn't that what the anti-flash crowd has been saying all along? Other video players may have an easier time providing good performance, but they still can get better performance. If Adobe is happy solving different problems they should accept that their customers who have a problem Adobe doesn't solve will be looking towards other solutions.
There's also the sticky issue of vast performance differences between windows and OS X/linux on the same hardware, but even if we accept your thesis that this isn't really Adobe's fault, it doesn't excuse the poor performance.
I didn't see anything in that post that disproved that Flash is a CPU hog.
I work with Flash and AIR apps on a daily basis, and I can tell you that invariably by the end of the day my browser's Flash plugin is using the majority of my CPU time and RAM.
Except if you'd read the article you'd know that when running HTML5 things (apps?) that do similar things to Flash, the CPU gets a similar hit as to when Flash does it. This is the point of the article: multimedia web content along the lines of what flash does (excepting video playback) is by its nature something that utilizes significant CPU power. You can't have your cake and eat it too.
Exactly. If it's hogging the CPU, it's hogging the CPU--it's irrelevant if it's more or less a hog than something else really.
Truth be told, I'm only running a Mac Mini. That being said, iTunes seems to be more efficient at streaming audio, video. Other desktop applications seem to do a better job at graphics in general.
I guess part of the performance hit one experiences with Flash is due to the overhead of a nice cross-browser, cross-platform, web-oriented runtime. Java applets, which do more or less the same thing, are also pitifully sluggish, in my experience.
It's more than relevant whether something hogs a CPU compared to another program that does an equivalent thing. No one complains when Crysis hogs the CPU, because we all expect 3d games to hog the CPU. People complain when Flash hogs the CPU, but seem to forget that HTML5/JS apps that do equivalent things often hog the CPU just as much, if not more. That is the relevance.
I recently tried out a demo of a "high-speed" side-scrolling game library for flash. It ran OK, but not terribly impressive considering how little was going on. But it seemed really familiar somehow... Eventually I realized that it was nearly identical in both content and performance to a Univesa (like DirectDraw for MS DOS) demo that I ran on my Pentium1 60Mhz back in 1996.
I would be curious to see how the same benchmarks pan out for running flash on some of the popular Linux distros, e.g. Debian, Ubuntu, Red Hat. I write from the assumption that Adobe sees little incentive in ever releasing decent flash support for Open Source OS's, but a quantitative comparison would at least be informative.
What about a "disclaimer, I'm an Adobe employee" in the post? It's kind of obvious that he is, and a quick look on the About page confirms it, but I find it more than a little dishonest that he's talking about his employer's technology without disclosing that fact.
If you look at the front page of his blog, you can see that he's blogging about flash quite frequently. For any normal viewers of his blog, they will already know about his Adobe connection and the stances he will take with flash. We're just in the unfortunate position of popping in for this one blog posting.
One solution would be if he had a brief bio in the sidebar beside each blog entry, but otherwise I would not expect him to put a disclaimer on each post he makes.
Amongst my friends, the joke is that you need at least two cores, one for listening to music on Pandora and one for other things. On my quad core phenom II (Linux) Pandora uses nearly a whole core. There is nothing within Pandora that justifies such cpu usage. Same goes for video. A youtube video shouldn't be using 25% cpu (one core) on a decent quad core. (Note: windows and other variations have better CPU performance, but in Linux world Flash has never been very decent).
If you're interested in pandora without flash, you might want to check out pianobar - http://github.com/PromyLOPh/pianobar - it has pretty much all of the functionality without the overhead.
No one believed me and people actually thinks I am being snide towards Apple/Adobe when I told them during winter, when my heater was not working so good for one week I would play a flash video on my macbook and put my palm under the laptop to keep myself warm. Yes, it does indeed gets that warm and I am not joking.
I have a 18 month old macbook pro with only 4gb of ram and a 2.4 Ghz intel core 2 duo running snow leopard. I believe you because that is exactly my experience.
As anybody with a netbook can tell you that many videos which are extremely choppy in flash (yes, even if fully buffered) are quite playable in vlc for instance.
Now given that one of the main uses for flash is streaming video, that should simply not be the case.
Mike's an adobe employee. Obviously. Here's the problem for Adobe -- it's not just apple / apple employees / apple devs that despise flash. The performance sucks ass, no matter what deluded blog posts they publish. I know this because flash runs on my computer, and I'm gonna believe my lying eyes over their nonsense.
Instead of having employees run all over the web lying about flash performance when people see the truth right in front of them all day long while using the internet, perhaps he and adobe should try fixing things? Just a thought.
I second that. Using Flash to simply play video on Linux/Firefox drives my CPU up to 100%. No matter what benchmarks or graphs you contrive to show me, I can HEAR my box's fans getting loud.
From my point of view, problem with flash is not that it uses inordinate amounts of CPU time when doing something "useful", but that it consumes incredible amounts of CPU event when it does nothing. On my laptop, there is clear correlation between opening something like youtube video and firefox taking 99% CPU few hours later and refusing to even close (and requiring restarting by means of "killall firefox-bin"). Every time when I had to forcibly kill firefox without flash plugin I was able to find some reason why it had hanged (and in most cases it simply hanged, not consumed 100% CPU), like malicious JS code.
Also, flash is only thing that is reliably broke by suspend to disk on my laptop.
So for me, there is not room for improvement in flash, but flash is simply broken piece of crapware.
It took a lot of whining for them to get started on it, but there was and is plenty of room for improvement. The argument about heavy media using a lot of CPU in HTML5 and bad developers who don't care about users only goes so far. Ultimately, Flash is what's being used for CPU hogging sites, Flash developers are the ones pushing the boundaries on a large part of the web, and the makers of Flash need to keep up with their developers.
When Canvas or JS becomes annoying it will be up to browsers to fix it, include click to Canvas, do whatever it takes so users keep using the web. If they fail at this, they'll have a hatefest coming their way.
Right now, most implementations of HTML5, Canvas, and SVG aren't so fast. I've seen demos that show them getting fewer frames per second than Flash for animations. But the point is that they're open technologies whose implementations can and will improve. Flash has been a closed technology for so long and Adobe has taken that lack of competition and ignored performance concerns.
With video, it's the same situation. While browsers might not be using less CPU right now playing H.264, there's the potential for better decoding in the future. VLC uses very little resources on my Mac decoding H.264 video. It's not merely Safari's access to hardware acceleration since VLC doesn't use hardware acceleration.
The problem with Flash is that it doesn't allow companies like Apple, Mozilla, Google, and even Microsoft the opportunity to increase efficiency; it doesn't allow an army of volunteers to improve a code base. It's just stagnated since there was no other way to do animation and vector graphics until recently.
The problem with Flash isn't where it is now in comparison to other techniques. The problem with Flash is that the other techniques are open and improving at a rapid pace while Flash isn't. The problem with Flash is that open technologies have lots of smart people working to improve them and make their implementations better while Flash is remaining much the same.
Our objection to Flash is that we can see what happened with JavaScript and Ajax (from apps like Google Maps and Gmail to toolkits like jQuery and Prototype) happening with vector images, animation, and video if there's an open standard that all companies and individuals can freely implement and use; with Flash, all we can see is Adobe continuing to feed us the same product we've had for years.