www.fgks.org   »   [go: up one dir, main page]

Testing Battery Life and Performance with Flash Player on the Nexus One

May 24th, 2010 by ryanstewart

When I did my video of various bits of Flash content running on the Nexus One, the overwhelming theme that kept coming up was battery life. I know battery life is something that both users and Flash developers are curious about. Flash provides access to a wealth of rich content. Video, games, and animation are all things that are much more processor intensive than rendering static images and text. In general, Flash content’s impact on battery life is comparable to other similar multimedia technologies. Where Flash really shines though, is that it uses the same amount of battery as other technologies, while providing a much richer experience with significantly better performance.

With all of the questions I wanted to provide some numbers about battery life but didn’t think that my rudimentary tests would be very good so I asked Vinay Ramani, the group product manager for mobile runtimes if his team had any data. These are very early initial tests but I thought they were worth sharing. You’ll be seeing more in-depth stress tests from us soon but hopefully these early numbers give you an idea of the fairly small impact that Flash Player in the browser has on battery life.

These are pretty close to clean-room tests. The team hooked up the meters and performed each test under a strict set of conditions:

  • Wi-Fi – off
  • 3G – on
  • OTA Push – off
  • Volume – on, at one notch
  • Bluetooth – off
  • Only browser is loaded, nothing else
  • 3G, lying flat on a table

Also, keep in mind that this is ALL done in software. Hardware acceleration is coming down the road but we wanted to make sure that this thing ran lean and mean in software without hardware acceleration at first. We also have ways that developers can control how SWF content loads on their pages so they can give certain SWF files priority and the Flash Player will give those a higher percentage of the resources. This should result in a smoother browsing experience.

Video

Video is probably the thing I get asked the most about with respect to battery life and it’s a good thing to compare because since both Flash Player and the Nexus One’s native player support H.264 you can get a good feel for how the battery life stacks up between native H.264 and H.264 video played through Flash Player. The team used the same YouTube video, one encoded at H.264 baseline level 2.1 at 30 fps with a resolution of 480 x 270. They did two sets of tests, one was on full brightness and the other was on half brightness. Then they just kept playing the video over and over again.

On full brightness, the Nexus One without Flash Player got 3 hours and 45 minutes. Playing the video through Flash Player gave a battery life of 3 hours and 8 minutes. Not a big dropoff. At half brightness it was even better. The Nexus One without Flash got 3 hours 56 minutes and the Flash version got 3 hours and 31 minutes. Just a 10.5% change, which isn’t bad at all considering everything Flash Player does.

Gaming

As you can see from the Flash/non-Flash tests, video is pretty intensive no matter what. What was even better was the battery life around games. There wasn’t a good way to test non-Flash versus Flash, but the team took a couple of popular Flash games, Tic-Tac-Toe and Alchemist, and played them until the battery died.

Tic-Tac-Toe lasted 6 hours and 49 minutes while the device could play Alchemist on the Nexus One for 7 hours and 7 minutes. While they aren’t intense 3D games, that’s pretty spectacular battery life and this was on full screen brightness. If you’re a game developer you can be sure that people playing your Flash game are going to be able to play it for a loooong time.

Animation

Let’s also quickly talk about HTML5 and Flash Player on mobile devices both in terms of performance and battery life. The team used the exploding balls test from Cameron Adams and tested the Canvas versions and the Flash versions. This one is a little tricky because part of the impact on battery life is how many CPU cycles are being used. And the higher the frame rate, the more CPU content is going to use. So it’s tough to compare HTML5 and Flash content directly because right now HTML5 content just doesn’t run very well on devices. The canvas example runs at 6.7 frames per second while the Flash version runs at about 24 frames per second. The difference between those ends up being minimal even though Flash has so many more frames per second. With the canvas test you get about 3.1 hours of battery life and with Flash Player you get 2.9 hours of battery life. A difference of about 12 minutes. We’re going to be doing some more exact tests around this where we equalize frames per second, so you should see some dramatic improvements once the test can be normalized.

This is just a sample of some of the early numbers that we’re getting. As I said, we’ll have some more detailed tests soon, but this should show that the hit for running richer content isn’t as big as one would think. The teams have done an absolutely phenomenal job of creating a runtime that performs on par with the desktop player and doesn’t sacrifice much at all in the way of battery life. If you’re a Flash developer, the exact same things that got you excited about Flash Player on the desktop now apply to mobile devices. The mobile world is your oyster Flashers.

Now Flash on.

Posted in Adobe, Flash, Flash Player

6 Responses

  1. Peter Baird

    I’m just imagining the flash engineers locked in a room forced to play tic-tac-toe 6 hours and 49 minutes… probably doesn’t want to ever see that game again.

  2. dan mcweeney

    Great, these are the tests people really want to know about ( and I’ve complained weren’t being done ) — how does “real world” use affect their phone! Kudos to the Player team for getting these anywhere near as close as “native” code, that is certainly an achievement.

  3. Gary Gilbert

    Seeing the demo done by Nick Saint of the beta version it appears that flash it still has a way to go.

    http://blogs.forbes.com/velocity/2010/05/24/flash-for-smartphones-is-finally-here-and-it-is-terrible/

    Of course the page loads are goign to be slower on the nexus one in comparison to the iPhone where flash content is concerned since the iPhone ignores the flash content. But the scrolling part of the demo does really show some work still needs to be done.

  4. Scott Janousek

    Look forward to the official data results from the testing.

  5. Scott Janousek

    Are they running 2.1 or 2.2 on the N1 for the tests?

  6. Raju Bitter

    Thanks for posting this, Ryan. Despite the fact that you work for Adobe, you have shown a lot of fairness in blogging about other RIA frameworks and technologies. I doubt that HTML5/Canvas are more effective on mobile phones right now than Flash is – unless you’d optimize the browser for hardware acceleration with CSS animation and JavaScript. But then, you can always do the same thing for mobile Flash apps – as long as the OS manufacturer does give Adobe access to APIs enabling acceleration.

    If there’s a scrolling issue with Flash on Android 2.2 with the beta version of the player, that’s going to be fixed at some point. I haven’t experienced similar problems with the PC/desktop version of Flash, and there’s no technical reason I’m aware of for the mobile environments that should keep Adobe from improving performance here.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

About Ryan Stewart – Rich Internet Application Mountaineer

A blog by a Platform Evangelist at Adobe covering Adobe's RIA platform. Includes posts about Adobe Flex, Adobe AIR, ColdFusion, LiveCycle, Thermo, and everything in between.