News for hackers. Stuff that matters.
Re:Flash is faster, better, stronger than HTML 5 on phones? by modeless on Monday September 20, 2010 @01:44AM (#1707933)
The problem is Apple hasn't enabled hardware acceleration for Canvas on Mobile Safari. If this demo was instead using CSS transforms and animations, which are hardware accelerated, it would run locked at 60 FPS no problem.

Hardware acceleration for 2D Canvas would be nice to have, but what would be even better is WebGL. That would blow Flash out of the water for sure. WebGL was recently enabled by default in Firefox 4 nightly builds so it's looking like a lock for the final release; hopefully Apple and Google follow suit.

Re:Flash is faster, better, stronger than HTML 5 on phones? by brah on Monday September 20, 2010 @02:53AM (#1708045)
As a developer, i hope Flash and html5 will coexist ,innovate and outperform each other to blow our minds.
Re:Flash is faster, better, stronger than HTML 5 on phones? by timdorr on Monday September 20, 2010 @03:35AM (#1708127)
The same guy did some demos of CSS3 animations on the same hardware: http://www.blackcj.com/blog/2010/09/19/css3-excels-on-ios-bu...
Re:Flash is faster, better, stronger than HTML 5 on phones? by est on Monday September 20, 2010 @01:57AM (#1707957)
Is Flash on mobile devices hw accelerated or sw rendered?
Re:Flash is faster, better, stronger than HTML 5 on phones? by brah on Monday September 20, 2010 @02:53AM (#1708044)
Yes. Hardware acceleration is available in Flash10.1 for Android. Flash leverages on hardware acceleration only when absolutely needed( for H.264 decoding etc ).

As a simple ball bounce animation, i dont think hardware acceleration kicks in during this demo. With all the html5 love Apple is showcasing (apple/html5), they should have enabled hardware acceleration for html5 long before.

Re:Flash is faster, better, stronger than HTML 5 on phones? by modeless on Monday September 20, 2010 @04:14AM (#1708193)
They did enable hardware acceleration for some parts of HTML5 (and it's quite impressive when used), just not for Canvas. They're not alone; no implementation of Canvas was hardware accelerated until IE9. If you ask me, hardware acceleration of Canvas is a no-brainer, and it should have been in the very first implementation. It's frankly embarrassing that it took IE9, of all things, to make browser people realize that graphics hardware is orders of magnitude faster than software rasterizers, and that's important.
Re:Flash is faster, better, stronger than HTML 5 on phones? by modeless on Monday September 20, 2010 @02:23AM (#1707998)
Both. I could be wrong, but I don't think this particular demo uses Flash's hardware acceleration support. I'm not surprised that Flash's software rasterizer is faster than Apple's Canvas.
Re:Flash is faster, better, stronger than HTML 5 on phones? by jdietrich on Monday September 20, 2010 @03:19PM (#1710143)
We've been here before. Present performance means very little. What is relevant is the rate of change. It seems perfectly clear to me that the HTML/CSS/JS stack is improving much faster than Flash. Unless that rate of improvement significantly slows or Adobe significantly improve their rate of development, HTML/CSS/JS will inevitably overtake Flash fairly soon.

Given that we're in the middle of a browser war, I don't see how Adobe could possibly compete. In order to beat WebKit in the long term, they would need to out-spend and out-think the combined forces of Apple, Google, Nokia, KDE, RIM, Palm, Samsung and a small army of other developers.

I have to give credit to Adobe - Flash is fast, easy and generally works well. There's a hell of a lot wrong with it, mainly the lack of standards compliance and how little effort they've made on accessibility, but it is undoubtedly a good product. That's not really the question we're interested in though - the relevant question is what will be faster in a year or eighteen months. I will be absolutely astonished if Adobe isn't comprehensively beaten by the end of next year.

That isn't to say Flash is dead, there are a lot of avenues for Adobe to pursue and they still have huge momentum, but they're going to have to either up their game, specialise, or face the inevitable fate of any technology that doesn't iterate fast enough.

Re:Flash is faster, better, stronger than HTML 5 on phones? by extension on Monday September 20, 2010 @04:57AM (#1708241)
Is there some reason to expect one to be faster than the other? Each is essentially JavaScript plus vector graphics. Some particular implementations might suck more than others but they are ultimately the same sort of technology.

If anything, I would think that Flash has the potential to be faster since it was designed from the beginning to do only what it does, whereas <canvas> is an extension to the already massively complicated technology blob that is HTML.

Re:Flash is faster, better, stronger than HTML 5 on phones? by kreek on Monday September 20, 2010 @09:27AM (#1708687)
Both languages are essentially ECMAScript, but ActionScript (3) is static and JavaScript is dynamic. Java is faster than ruby/python etc and ActionScript is faster than JavaScript.
Re:Flash is faster, better, stronger than HTML 5 on phones? by rryyan on Monday September 20, 2010 @05:07PM (#1710506)
Gruber linked to a developer who doubled the iPhone 4's framerate (to 45 FPS) with a simple optimization: http://daringfireball.net/linked/2010/09/20/not-so-fast

Looks like the improved version erases just the previous frame's ball, instead of clearing the whole canvas (just my best interpretation -- I'm not familiar with the canvas API).

EDIT: This link details what's going on here:

One important optimization rule to follow is to reuse as many pixels as possible between frames. What I mean by that is the fewer pixels that need to be processed each frame, the faster your program will run. A good example of this is when erasing pixels with the clearRect(x,y,w,h)method, it is very beneficial to clear and redraw only the pixels that have changed and not, for instance, a full screen 1920x1280 sized canvas. Unlike the Flash Player’s redraw regions, this management of "dirty rectangles" needs to be done manually for canvas. [http://www.kontain.com/fi/entries/94636/]

Apparently Flash Player optimizes the reuse of pixels automatically, and MobileSafari does not.

Re:Flash is faster, better, stronger than HTML 5 on phones? by jdc on Monday September 20, 2010 @03:20AM (#1708099)
Relevant:

Speed Test: Flash vs HTML5 On The Nexus One [video]

http://news.ycombinator.com/item?id=1657853

Re:Flash is faster, better, stronger than HTML 5 on phones? by nihilocrat on Monday September 20, 2010 @10:17AM (#1708880)
This is more than double the frame rate of Apple’s offering and is still 17 frames faster than the HTML 5 version on the same Nexus One.

Everyone even relatively familiar with graphics rendering should involuntarily cringe when hearing comparisons like this.

See the light: http://www.mvps.org/directx/articles/fps_versus_frame_time.h...

Re:Flash is faster, better, stronger than HTML 5 on phones? by wtallis on Monday September 20, 2010 @02:16PM (#1709904)
That article forgets that it only applies to relative performance comparisons. Frames per second is still a perfectly valid and useful unit for measuring the performance in an absolute sense: 24fps is just barely enough to be perceived as smooth animation by some people, but 40fps will be perceived as smooth by almost anybody, and and at 57fps, you're closing in on the limitations of consumer display technology, so you can stop optimizing.
Re:Flash is faster, better, stronger than HTML 5 on phones? by weavejester on Monday September 20, 2010 @07:57AM (#1708463)
Frankly, I'm surprised that HTML5-based animations are now only 30% slower than Flash. A few years ago it was nowhere near that.
Re:Flash is faster, better, stronger than HTML 5 on phones? by kreek on Monday September 20, 2010 @09:13AM (#1708640)
Both ActionScript and JavaScript are based on ECMAScript. However given equal environments (access the hardware exceleration or not) ActionScript will always be faster because it uses strong typing and at then end of the day is compiled into a SWF.
Re:Flash is faster, better, stronger than HTML 5 on phones? by kreek on Monday September 20, 2010 @11:30AM (#1709161)
woops hardware acceleration, hardware exceleration would be cool though :)
Re:Flash is faster, better, stronger than HTML 5 on phones? by StavrosK on Monday September 20, 2010 @08:24AM (#1708519)
Why does he say "57 fps" for the Flash version when the counter above says "37 frames"?
Re:Flash is faster, better, stronger than HTML 5 on phones? by CoryMathews on Monday September 20, 2010 @09:33AM (#1708705)
37 is when he is moving around, zooming in etc. Look in the bottom right and it will say 57.
Re:Flash is faster, better, stronger than HTML 5 on phones? by daleharvey on Monday September 20, 2010 @01:30AM (#1707902)
and the award for the biggest linkbait title goes to ...

I was pleasantly surprised when I seen my HTC Desire running flash, but then after a few weeks it just got annoying and I turned it off, battery performance went up, and I have not once had an inclination to turn it back on.

Re:Flash is faster, better, stronger than HTML 5 on phones? by acqq on Monday September 20, 2010 @04:22AM (#1708203)
It's easy to understand where the annoyance comes from.

There's a big difference between comparing a "good written" flash thing which you make yourself and having the flash enabled while browsing the web. With first you can demonstrate Flash's superiority, with the second you're picking up all the incompetent code written by anybody and almost 100% of it is used only to make something totally unimportant just moving to get an attention from you.

When we consider Flash as the content delivery mechanism and not the movement based attention taker we're left only with videos and games on the web. But both should be optimized for mobile. For video, transcoding is needed. For games, better writing them native.

Re:Flash is faster, better, stronger than HTML 5 on phones? by elblanco on Monday September 20, 2010 @08:53AM (#1708588)
Just wait till all those incompetently written advertisements, video players, etc. are all written using HTML 5 standards. Pretty soon we'll all have an extension in our browsers called "Canvas block".
Re:Flash is faster, better, stronger than HTML 5 on phones? by acqq on Monday September 20, 2010 @10:03AM (#1708819)
Would blocking canvas be even enough? Or would we need "HTML5 block" to avoid constant annoyance? And what's going to happen on all these devices where we can't install extensions?

That's why I intend to use Opera Mini as long as it works.

Re:Flash is faster, better, stronger than HTML 5 on phones? by ZeroGravitas on Monday September 20, 2010 @05:06AM (#1708249)
Why didn't you set it to on demand in the first place? Having it on full time, then having it off full time seems a bit extreme in both directions.
Re:Flash is faster, better, stronger than HTML 5 on phones? by ergo98 on Monday September 20, 2010 @10:10AM (#1708844)
I second this. In fact I always find comments along the lines of "I tried Flash but then uninstalled it" curiously suspicious: It is very common knowledge that it should be set to ondemand, as otherwise you will drown under a sea of hundreds of heavily animated advertisements.

I have it on ondemand, and while I seldom enable it, when I do I appreciate that I have the option.

Re:Flash is faster, better, stronger than HTML 5 on phones? by daleharvey on Monday September 20, 2010 @01:57PM (#1709815)
turn it off = on demand
Re:Flash is faster, better, stronger than HTML 5 on phones? by MhdBadi on Monday September 20, 2010 @03:04AM (#1708072)
That's true "so far" but i think we should wait more and see new improvements coming.
Re:Flash is faster, better, stronger than HTML 5 on phones? by Humblecoder on Monday September 20, 2010 @06:37AM (#1708349)
Sorry if too off topic, but the last line of the first commenter is exceedingly random.

"--Call me an Apple Fanboy, fine. But there's a reason I've got work, how bout them Windows Developers?--"

Is he actually implying there is no work for Windows developers?