Monday, May 17, 2010

Performance benchmarks... or lack thereof

A friend of mine was over the other day and I was showing him this cool website I had recently heard of, grooveshark. So after admiring it for a little while he came out with "pity it's written in flash". So of course I asked the obvious question "Why?" and got the obvious answer "Because it's inefficient and sucking up all your CPU". He popped open 'top' and sure enough it was using 35% of my cpu, his point was proven.

However, that is completely and utterly irrelevant. This does not make flash a bad technology nor does it make grooveshark a badly written application. Maybe 35% cpu usage is just the cost of running in the browser. It's like the old complaint against firefox, "Firefox uses too much memory". By itself that means absolutely nothing. It's nonsense. For that to have any real meaning you'd have to compare firefox to another browser doing the same task. A legitimate complaint might be "Firefox uses 3 times more memory than opera when I view www.example.com, 300 mb versus 100mb". An arbitrary decision as to what amounts to be "too much" is useless without a reference. This is exactly what far too many people are doing to flash.

Sure, grooveshark uses more CPU and memory than banshee, but banshee isn't running inside firefox. It annoys me that people make such arbitrary decisions and try to pass off as fact that flash is inherently bad and HTML5 is inherently so much better and yet have no reference to compare against. I haven't seen anything even close to the complexity of grooveshark written using html5. So before you get on your high horse decrying all plugins, show me a comparable application which uses $COMPETING_TECHNOLOGY_OF_CHOICE and performs measurably better.

16 comments:

Anonymous said...

What a load of horse shit. Any application that is using 35% CPU doing nothing is broken. It doesn't matter what technology it was written with. You have the ENTIRE history of software development to back that up.

Alan said...

I thought it was obvious enough that i opened up grooveshark to do *something*...

Rageous said...

Grooveshark desktop client eats 2-3% of my Core2Duo on win7. Grooveshark web client also consumes only 3-5% of CPU in Chrome.

35% of CPU for almost static image and MP3 decoder? Sounds like a bug.

Anonymous said...

Well, if it was written in SilverLight instead of Flash, it could have been run out of the browser right? :)

Rageous said...

It's written using Adobe Air and was able to run out of the browser from the very beginning :)

Mark said...

It does make sense to say "XXX uses too much memory", even without an application to compare it to. Example: "My machine has 2 GB of RAM, but Firefox uses 93 GB when I point it to stupidsite.com. That's way too much!". Or: "I need to have that Hello-World C++ program compiled by next week, so I simply can't have Grooveshark using 70% CPU - that's too much!".

Alan said...

schani: what if stupidsite.com is a site which generates an inmemory rainbow table? In that case 93GB might be a lot less than expected ;)

Mark said...

A Ferrari might actually be reasonably priced, considering its characteristics and build quality. Still, for my wallet, it's too much.

cairey said...

You are correct in what you say, but generally I think people do compare against something else.

FireFox has memory leaks, longer you leave it open, the more it consumes.

Flash eats the CPU, but so does Silverlight.

Anonymous said...

As you wrote "he fired up top" i highly assume the box was mac os x or linux box. i can absolutely tell that the performance of flash on non-windows boxes is very poor, every linux/mac user can tell you how slow even video playback and other flash stuff is. watching a youtube video in HD is the only thing that makes the fan of my macbook spin up so loud it can actually be heard. playing 1080i content in h264 consumes less CPU via vlc than flash playing a vga youtube clip in flash..

rektide said...

apologies alan, but almost any flash app i load seems to start a flash process that from that point on consumes > 10% CPU. i have 25 tabs open atm in chrome, and cpu usage is right around 3%.

the firefox case is even worse.

if it takes a huge resource balloon to run flash in a browser, regardless of how big a balloon that is, where is the browserless flash client? where does this hit not effect end users?

aside from wasting resources, my second gripe is that Flash's linux support is barely second class citizen worthy. after years of waiting for x86-64, this winter's beta finally got hulu working and some basic gpu acceleration-- it felt like maybe things were turning around. but hulu stopped working and gpu acceleration has been outpaced by windows and osx and Flash/Linux is again just another barely working second class citizen.

Alan said...

"apologies alan, but almost any flash app i load seems to start a flash process that from that point on consumes > 10% CPU. "

That's slightly missing the point I'm trying to make. Lets ignore flash for a minute and agree that having dynamically updating content on a webpage uses up valuable CPU time. Lets also assume that this is valuable content that we want to consume (i.e. not banner ads).

The question you should then be asking is "Is flash *better* or *worse* at displaying this dynamic content inside BROWSER_OF_CHOICE than its competitors". That's the question not many people appear to be asking. Surely if there was a viable alternative with better performance characteristics people would start flocking to it, right? Benchmarks I've seen between flash and HTML5 canvas stuff appears to put flash at a huge performance advantage.

Anonymous said...

@Alan I thought it was obvious enough that i opened up grooveshark to do *something*...

If that something is listening to streaming music (which is like, nothing, CPU-wise) then 35% is a hell of a lot.

Now, if you only do open your PC to singletask listening to music on grooveshark, I guess 35% is OK. Even 70%.

sports handicapping services said...

Nice post once again. Thanks for sharing this kind of informative post.

aliyaa said...

People must ask well office manager cover letter ..posting and writing also. I just hope this will bring positive change.

James Charlie said...

Exceptional post! Enjoyed reading it. Definitely, the approach of hiring professional assignment help experts to take charge of the complex scholarly writing tasks is a smart investment in today competitive scenario. You can get your hands on a perfectly drafted assignment solution that can act as a reference for all your future writing tasks at highly economical prices. In such a scenario, opting for the online Dissertation Editing Services by the MyAssignmentHelpAU platform can be a smart choice. Visit their official website right away to explore the wide array of assignment help services they have in store for you.

Hit Counter