Loudtalks — internet walkie talkie

WPF/e vs DHTML vs Flash vs WPF performance test

By Alexey Gavrilov on February 27, 2007

WPF/e benchmark screenshot

If you just want to try it yourself here is the page with all tests.

Below are some benchmarking results I got using IE 6.0, Firefox 2.0 and Opera 9.0 on my laptop. For those of you, who like reading here is a longer story.


When Microsoft announced WPF/e, which is a small browser plug-in (currently available for IE, Firefox and Safari) allowing to incorporate XAML islands into HTML and script them with JavaScript, I was immediately excited. I don’t like Flash and it sounded like a solution, which can compete very well with it. Last weekend I finally get to actually playing with it and decided to test the thing on bouncing balls animation (it was a huge hit in 1996, when I coded it in Borland Pascal 6.0 for my CG-classes, so it’s a good flashback too). Since WPF/e coding is JavaScript I couldn’t hold myself from creating DHTML version too to compare the performance between them. It was especially interesting because the only difference is a presentation layer. After thinking about benchmarking aspects of the problem I decided to add Flash to the list, because it’s de-facto standard for web animation today and ActionScript is very similar to JavaScript so the port was going to be easy. Finally I went for pure WPF version too just to see, whether WPF/e is closer to it or to DHTML and also to have the reference point for fundamentally slower script-based implementations.

I started by drawing a ball in Adobe Illustrator and exporting it as PNG for DHTML version and SWF for Flash one. For XAML export I used XAMLExport 0.11 Illustrator plug-in from Mike Swanson, which worked almost fine (it didn’t manage to keep gradients appearance but I didn’t care that much about it) (update: Mike pointed out that he has more recent version now, which has many bugfixes including some related to gradients). Of course I could load PNG into WPF/e instead but it seemed conceptually wrong (I tried it later and it didn’t make much difference in terms of performance).

With artwork in hands I implemented DHTML version fast and proceeded to WPF/e. I only had to override a couple of methods, which directly access XAML DOM. Not later than I get to the clone method, which was supposed to clone existing ball object I faced the problem. WPF/e won’t allow you to clone its XAML nodes. I tried hard but it seems just impossible (tell me if I’m wrong). You can make new nodes using CreateFromXaml() and append them to the DOM but there is no innerXAML or any other similar function to get XAML of a certain node. I ended up hard-coding XAML representing the ball inside the method. It looks bad and I really hope next release of WPF/e will fix this. Another issue I noticed with WPF/e is that it takes some time after window.onload event for control to initialize and you have to use Loaded handler of its root element to identify control ready state. The function has to be globally defined, passing object’s method there didn’t work. This created need for things like isLoaded and more global variables. It works but I don’t like globals in JavaScript. All in all WPF/e version was ready and it worked faster than DHTML!

Now it was time for Flash and I readily found that I positively can’t do anything meaningful in it. Maybe it’s just because I’m dumb (and in fact I know that many people are fine with Flash). I almost gave up but then decided to take a look at Flex. I’ve heard a lot about it and knew many people like it so I decided it’s time to finally try it myself. I’m glad I did because it’s awesome!

Having said this I had severe problems with it initially before I figured out how namespaces and classes are related to folders and file name. It must be written somewhere but it literally took me hours of flip-flopping between two errors “1120: Access of undefined property” and “1037: Packages cannot be nested” before I realized, what I’m doing wrong. Here is the thing – in Flex you must not include ActionScript files with classes into your mxml using mx:Script as you typically do in HTML. If you do so you will see 1037 error. Instead you have to put them into file system according to the class name and namespace. I think it’s totally strange but in order to plug class MyTest located in Test namespace you must name the file with the class MyTest.as and put it into Test folder. It’s case-sensitive, which even hardens the catch. If anybody from Adobe is reading this – guys, please fix it or at least make it clear in the manual.

Once I get used to this the rest worked great and I ported the demo from DHTML to Flex in no time and the code looks even simpler than it was in JavaScript.

WPF part was a little bit painful because I had to translate JavaScript to C# and yet find the way to clone XAML nodes (I hoped that real WPF can do that). In theory there are XamlReader and XamlWriter classes, which could be used for the task however I didn’t manage to make them work and quick googling didn’t bring in the solution. Since I wasn’t going to spend the rest of my life on this task I ended up making custom control, representing the ball and then it was easy to dynamically add as many copies of it to the document as I needed.

Here are results I got testing with 16 balls on my Pentium M 1.7 laptop:

Browser DHTML Flex Flex (caching) WPF/e WPF
IE 6.0 56 61 90 84 99
Firefox 2.0.0.1 55 52 60-90* 58 -
Opera 9.01 94 50 100 - -

* fps in Firefox was extremely unstable in this case, not sure if it’s something to do with my setup.

Update 02/28/2007

I added Flex results obtained with cacheAsBitmap option on. It’s not noticeable unless you set balls # to something big to slow down but this option cuts off right and bottom lines from some objects. Here is the screenshot.

In DHTML test Opera was just unbelievably fast — almost as fast as “native” WPF! (Changing conditions of the test changes it though. If embed the same test into more or less complex page Opera slows down to about 50 fps. At the same time WPF shows the very same 99 fps not only for 16 but also for 128 and more balls, when all other frameworks are below 10.) WPF/e is much faster in IE than in Firefox, which seems equally slow for all three tests. The expected result is that WPF runs faster than anything else. The unexpected is that WPF/e is faster than Flash despite the fact that it’s been in the market for years. I haven’t had a chance to test on Mac yet and tested with IE 7.0 on different machine (it seemed relatively slower but can’t actually compare).

While this test as any artificial benchmark is not perfect I think it’s handy to compare things. Easily interpretable visual representation makes even more useful. You can actually see how the browser manages the task, notice lags or sluggish performance etc. So next time, when you read that the new version of Firefox has improved performance you can just run the test and see if it has more frames per second.

How your PC / Mac performed in these benchmarks? I appreciate if you can post your results in comments along with your system configuration. The source code for all tests is available for you to hack it the way you like.

Share this!
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Technorati
  • Furl
  • Slashdot
  • BlinkList
(categories: Solutions box)

66 Comments »

  1. Hi, try adding something like this:

    this._id.cacheAsBitmap = true;

    to your FlexBall constuctor.
    Or run it in the standalone Flash Player :) Yes, I know it doesn’t count :)

    Comment by Bartek — February 27, 2007 @ 11:35 pm

  2. MacBook C2D, 2GHz, running Vista

    DHTML - 56 fps
    WPF/e - 58fps
    Flex - 57 fps
    WPF - 64 fps

    - vineet

    Comment by Vineet — February 27, 2007 @ 11:59 pm

  3. Try to add a line:
    newId.cacheAsBitmap = true;
    just after
    var newId : Image = new Image();
    in the FlexBall class of Flex sample. Application performance will increase twice :)

    And what about packaging and sources structure. Flex mainly targeted on Java guys but not C# guys. All the coding and packaging conventions in Flex are from Java world.

    Thanks for tests :)

    Comment by Constantiner — February 28, 2007 @ 12:14 am

  4. Guys, thanks for pointing out to cacheAsBitmap. However since WPF/e doesn’t have this option I think it’s fair to keep it off. Just kidding :-)

    If seriously I think this is why I wouldn’t even look at benchmark unless a) I can try myself, b) I can view the source code.

    Comment by Alexey Gavrilov — February 28, 2007 @ 1:14 am

  5. Alexey! I think you’re not right about cacheAsBitmap. All the technologies you compare have strengths and weaknesses. What about graphics WPF have strength in using hardware graphics accelerator possibilities. Flash player don’t use them. Because Flash-player targets on more platforms (Windows, Mac, Linux) and all contemporary browsers. And (new in FP8) option cacheAsBitmap is recommended and valid way to optimize graphics performance. Remember Flash player base on vector graphics and doesn’t support hardware graphics accelerators. If you want legal comparison of performance turn off accelerators in WPF and WPF/E examples :)

    And in standalone Flash Player I reach 150 fps :)

    Comment by Constantiner — February 28, 2007 @ 10:05 am

  6. Hmm… WPF and WPF/e are based on vector graphics too and in my tests the artwork is loaded as XAML and not as bitmap. WPF is of course a little bit off the line but WPF/e is cross platform just like Flash. Anyways I’ll add the version with cacheAsBitmap on to the list :-)

    Flash doesn’t use h/w acceleration… That’s right but I think it’d better use it. Since player binaries are different for different platforms anyways I think there is no real reason why it can’t do that. Moreover I’m sure that eventually Adobe will make this and it would happen sooner with the presence of competition from Microsoft. As the result both users and we, developers, will benefit :-)

    150 fps — wow, that’s a lot. What is your machine? How it compares with results of browser-hosted tests?

    It certainly lights up Apollo future because I was concerned that slowness of Flash (compared to native code) could make it less appealing for desktop development. I know that the speed has been improved great deal in 9.0 but still it seems way behind (although WPF is not fast either unless you have hi-end video card; on my Fire GL T2 it’s notoriously laggish).

    Comment by Alexey Gavrilov — February 28, 2007 @ 3:52 pm

  7. In FireFox 2.0 web based Flex test with cacheAsBitmap on my computer is about 55-60 fps. Win XP on AMD Athlon 64 3200+ 3Gb RAM.

    I hope in April I’ll present Flex (and maybe Apollo - if public version will be available) on .Net User Group meeting in St.Petersburg. Think I’ll tell a little about Flex / WPF / WPF/E comparison.

    Comment by Constantiner — February 28, 2007 @ 4:15 pm

  8. I just tested a version with cacheAsBitmap = true and in the browser (both IE and Firefox) the difference is subtle, while in standalone player I got the very same 150 fps (it’s likely just the limit for this kind of a test) for 16 balls and around 100 fps for 32.

    This leads to an interesting conclusion that it’s the browser, which degrades flash performance the most.

    Comment by Alexey Gavrilov — February 28, 2007 @ 5:36 pm

  9. cacheAsBitmap also seems to cut off right and bottom edges of the ball — looks kind of funny. Is it a bug or a feature?

    Comment by Alexey Gavrilov — February 28, 2007 @ 5:42 pm

  10. #8 is my test error. In fact the difference from cacheAsBitmap is big even in the browser: 92 fps vs 61 fps without it.

    Comment by Alexey Gavrilov — February 28, 2007 @ 5:47 pm

  11. I’m glad you did this, the speeds are all comparable and it’s a great test. You may also want to try using the Event.ENTER_FRAME event in the Flash example instead of a frame Timer as it can work better for animation in a lot of cases.

    The Opera result is a nice suprise.. for the DHTML example does it make a difference if the ball itself has alpha inside it, like the other examples?

    Results (Macbook Pro 2.33ghz):

    DHTML : 60 FPS
    Flex : 68 FPS
    WPF/E: 65 FPS
    WPF: Not applicable

    Would love to see a Flash 9 (non flex) version.

    Comment by Richard Leggett — February 28, 2007 @ 7:08 pm

  12. The cacheAsBitmap should not be cutting off the edge, possibly something in the code…

    Just responding to the person who mentioned the browser having an impact on these plug-ins. It can, particularly with Flash 9…

    If you use the fullscreen feature in Flash and then come back to the small window, you will get a big performance boost.

    Also you’re Flex link on each test page does not point to the bitmap version.

    Comment by Richard Leggett — February 28, 2007 @ 7:15 pm

  13. Thank you very much for posting this comparison. I appreciate the thoroughness in comparing not just the technologies, but actually comparing them across various operating systems and browsers.

    Comment by Chad Campbell — February 28, 2007 @ 7:17 pm

  14. MacBook Pro 2.16 GHz Core Duo
    Mac OS X 10.4.8
    Flash 9.0.28 (Intel native)

    Safari 2.0.4:
    DHTML: 141 FPS (not a typo)
    Flex: 50 FPS
    Flex (caching): 58 FPS
    WPF/E: 100
    WPF: NA

    Firefox 2.0.2:
    DHTML: 72 FPS
    Flex: 31 FPS
    Flex (caching): 42 FPS
    WPF/E: 64 FPS
    WPF: NA

    Windows Server 2003 R2 SP1 (running in Parallels 3186)
    NOTE: There seems to be more variability in the scores, with some ramp-up time

    IE7:
    DHTML: 80 FPS
    Flex: 70 FPS
    Flex (caching): 96 FPS
    WPF/E: 81 FPS
    WPF: 97 FPS

    Firefox 2.0.2:
    DHTML: 53 FPS
    Flex: 56 FPS
    Flex (caching): 64 FPS
    WPF/E: 58 FPS
    WPF: NA

    Comment by Dave Murdock — February 28, 2007 @ 9:04 pm

  15. Alexey:

    Great comparison! I noticed that you’re using version 0.11 of my Illustrator -> XAML plug-in. The current version (0.16) has a number of improvements over 0.11, including some gradient export fixes. You can always download the latest version here: http://www.mikeswanson.com/xamlexport/

    Thanks!

    Comment by Michael Swanson — February 28, 2007 @ 10:06 pm

  16. Michael

    Thanks a lot for your great XAML export plug-in! I added the link to the article and will update my version of course :-)

    Comment by Alexey Gavrilov — February 28, 2007 @ 10:38 pm

  17. 17″ MacBook Pro 2.33 Intel Core 2 Duo
    2GB RAM
    Mac OS X 10.4.8
    Flash 9.0.29 (intel Native)
    Same Window size in all tests

    16 Balls
    - - - - - - - - - - - - -
    Safari 2.0.4
    DHTML: 180 fps
    WPF/e: 131 fps
    Flex : 54 fps
    Flex Cached: 54 fps

    Firefox 2.0.0.2
    DHTML: 73 fps
    WPF/e: 65 fps
    Flex: 34 fps
    Flex Cached: 45 fps

    Comment by Scott Ahten — February 28, 2007 @ 11:33 pm

  18. those results in macosx(firefox & safari) are distressingly divergent. i mean someone from Adobe/Apple wanna explain why such a huge perf hit?

    this is great work alexey! for the next round i would create a particle simulation, where you create and destroy thousands of drawing primitive objects each second, all in code. and tabulate fps, mem footprint, proc usage, download size and relative developer ease in creating the programs.

    also maybe further optimize the flex app by writing it in pure actionscript and avoiding the flex container altogether.

    anyway, just a few thoughts on where you may want to take this research in the future, and i can fully confirm that these results are roughly in line with what i have seen in my own apps, though i am somewhat surprised pure wpf is not moderately higher..

    Comment by dude — March 3, 2007 @ 2:27 am

  19. Hey, dude, thanks for comments and suggestions. I’m actually considering the follow up including particles so you hit the bull’s eye with your comment.

    Comment by Alexey Gavrilov — March 3, 2007 @ 4:19 am

  20. Hi there.
    I’ve ran these tests under Win2003 and Vista (x64 both) and got some interesting results to think of.
    Win2003 were Opera, IE6 and IE7. Vista - IE7 only.
    I’ve got 64 FPS at every 16 ball test under every browser! Opera+Flex(cached) done 200+ fps right after system startup but 64 again little later.
    It’s kinda good in everyday browsing since animations don’t take 100% CPU no matter of lazy flash programmer.
    But it’s weird also. 32bit (i guess) windows results posted before weren’t that limited.
    I guess that there is a kind a framerate limitter. Good going.

    Comment by Stanislav "Slaim" Gorshkov — March 6, 2007 @ 3:26 am

  21. BTW XBAP version crashes under Vista (x64). I were keen to upload Microsoft a dumps. Wait for update of WPF soon =)

    Comment by Stanislav "Slaim" Gorshkov — March 6, 2007 @ 3:27 am

  22. […] Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it! by Filed under: Flash, WPF/E,.NET […]

    Pingback by Jesse Ezell Blog : WPF/E Faster than Flash? — March 14, 2007 @ 6:15 am

  23. If you take a look at Nikhil Kothari’s Blog (http://www.nikhilk.net/) he’s written a c# to javascript converter called Script#, ideal for building in WPF and down-levelling to WPF/E.

    I believe MS are building this into WPF/E anyway, and it’s probably Nikhil’s code they’re using, since he’s on the WPF team.

    Comment by Dave Griffiths — March 14, 2007 @ 5:16 pm

  24. Have you tried to freeze the WPF-objects, i think it would increase the performance for the xbap/wpfe-programs.

    http://msdn2.microsoft.com/en-us/library/aa970683.aspx

    Comment by Toodie — March 16, 2007 @ 9:54 am

  25. IMHO,
    Isn’t this kind of a ridiculous comparison since at this time WPF/E is basically nothing but the rendering engine while Flash has a runtime and all kinds of controls embeded into it. I mean I’m pretty sure Flash is also slower than a blank HTML page guys. It no fair when the other guy is runing without armour. Wait till WPF/E has to support CLR then do a comparison, as it stands the comparison just seems premature to me.

    Comment by John Gault — March 20, 2007 @ 1:14 am

  26. […] I used Adobe’s Apollo Alpha 1, which was released today, to package Flex and DHTML versions of my web animation benchmark. The goal was to try the thing in the action and see how its performance compares to Flex and DHTML animation running in the browser. […]

    Pingback by Metalink » Apollo Alpha 1 performance — March 20, 2007 @ 3:38 am

  27. @John:

    The benchmark compares performance in one particular task — dynamic 2D animation. It doesn’t uses controls, sockets, text etc. It is not meant to tell, which technology is better “in general” (it makes no sense).

    The only technology, which has “unfair advantage” in the comparison is DHTML because it uses bitmaps-based graphics as opposed to vectors in WPF(e) and Flex. It didn’t help it much though (except Opera’s phenomenal result).

    And yes, I’m waiting for CLR support too but I assume WPF/e with C# as code-behind will be even faster (we’ll see)

    Comment by Alexey Gavrilov — March 20, 2007 @ 4:23 am

  28. Perhaps you could try DHTML versions that used SVG, Canvas, and VML where applicable.

    Comment by Chris — March 26, 2007 @ 6:05 am

  29. Chris, thanks for your comment. I thought about it (ie SVG, Canvas, VML) but then decided that 1) it’s too much work, 2) it has no practical sense because it’s too much work and one should be crazy to use such approach (ie browser-specific vector graphics) in real life.

    Comment by Alexey Gavrilov — March 28, 2007 @ 3:15 am

  30. […] I posted all data I managed to collect on WPF/e vs DHTML vs Flash vs WPF performance test results to Swivel for analysis and visualization. Selected charts are embedded below — enjoy! Thanks to everyone, who posted his results — it made up total of 73 measurements, which I could never do alone. Along with fps itself I used fps / GHz parameter to be able aggregating results from different machines. I realize that Core 2 Duo GHz was not born equal to AMD Duron GHz but it’s better than nothing. […]

    Pingback by Metalink » Bubblemark results at Swivel — March 31, 2007 @ 4:55 am

  31. I may be wrong, but I think the WPF framerate is limited to monitor refresh rates. Would be good to vary the number of objects and see how far you can go with each platform before it dips below an acceptable framerate (say 15fps).

    Also, the video card details and driver date will contribute to the WPF test.

    Comment by Joe — March 31, 2007 @ 11:32 pm

  32. Interesting read; however, unless you are making a first person shooter, I think these results are a little misleading.

    I would like to see a comparison between WPF, Flash/Flex, and JavaScript when it comes to iterating over 200,000 elements.

    Comment by Dan Schultz — April 2, 2007 @ 8:41 pm

  33. […] I read this post of Ryan Stewart today, which inducted a little reflection on my own experience dealing with Flex. It started with WPF/e CTP release in December. We have been for a long time building on Microsoft’s technologies so I try to keep up with what’s new and couldn’t miss that. I got WPF/e, played with it and liked what I seen. Then I decided to find out how it compares with other RIA technologies around, which eventually lead me to trying Flex. […]

    Pingback by Metalink » WPF/e helps promoting Flex — April 4, 2007 @ 3:37 am

  34. Alexey,

    Neither Flash CS3 Pro nor Flex 2 will compile/recognize mx.controls.Image

    Where can I get it, which version did you use?

    Comment by Rolf Tollerud — May 2, 2007 @ 5:52 pm

  35. Rolf, I was using Adobe Flex Builder 2 (2.0.0.1), downloaded from Adobe’s website.

    Comment by Alexey Gavrilov — May 2, 2007 @ 8:46 pm

  36. Thank you, now its working. Results on my 3 GHZ Dual Core HP (16 balls)

    IE7

    DHTML 55 fps Processor 38%
    Flex 63 fps Processor 22%
    Flex (cashing) 64 fps Processor 1%
    Silverlight 64 Processor 41%
    Wpf 61 Processor 4%
    __________________
    Firefox 2.0

    DHTML 55 Processor 5%
    Flex 54 fps Processor 36%
    Flex (cashing) 70 fps Processor 1%
    Silverlight 58 Processor 42%
    Wpf –
    __________________
    Opera 9.20

    DHTML 64 Processor 11%
    Flex 65 fps Processor 45%
    Flex (cashing) 197 Processor 40%
    Silverlight –
    Wpf –

    The most intresting to me is the difference in CPU usage. I will test some more later with more balls.

    Comment by Rolf Tollerud — May 4, 2007 @ 2:48 pm

  37. […] Metalink » WPF/e vs DHTML vs Flash vs WPF performance test (tags: flash flashcs3 wpf silverlight performance) […]

    Pingback by The JJW Blog :: links for 2007-05-03 — July 7, 2007 @ 10:19 pm

  38. Flash kicks in the nitrous.
    http://www.kaourantin.net/2007/06/multi-core-support.html

    Pentium D 930 @ 3.3 Ghz (dual core)
    Windows 64 running 32-bit Firefox 2.0
    ** Flash Player 9,0,60,120 **

    62fps @11% CPU DHTML
    63fps @32% CPU Silverlight (JavaScript)
    104fps@36% CPU Silverlight (CLR)
    115fps@72% CPU Flash
    200fps@22% CPU Flash w/ cacheAsBitmap
    64fps @06% CPU Java

    AXBG

    Comment by Neal at A X B G — July 9, 2007 @ 8:52 pm

  39. I was looking at your code sample to see how you calculate frames per second in WPF. You could consider using the TotalSeconds property of TimeSpan in your _move_UpdateFPS method instead of Seconds (ball.xaml.cs); I think the current implementation will give a slightly optimistic result.

    Comment by david_dylan — July 31, 2007 @ 6:49 pm

  40. @david_dylan:

    Thanks for the comment, it makes perfect sense. In fact since we measure the FPS every 3 seconds the difference could be as large as ~30%.

    Comment by Alexey Gavrilov — July 31, 2007 @ 7:46 pm

  41. Hello
    First, congratulations for this comparison. But in order to complete it, shouldn’t it be interesting to add a test for XUL and a test for OpenLaszlo?

    Comment by Greg — August 13, 2007 @ 6:45 pm

  42. Thanks for this test, really useful!

    There does seem to be something quite amiss with the Silverlight CLR demo on my machine, however — specifically with how it reports FPS. I’m using the latest Refresh version, on Windows XP media, and FireFox 2.0.0.6.

    Even when I can count the framerate because it’s going so slow(with the number of balls set really high), the demo still reports FPS as being insanely high, anywhere from 80-500fps. The demo itself also seems to try to play super fast, not consistent with speeds of the other demos. All the other demos(including Silverlight JS) seem to report FPS accurately.

    Unfortunately, I don’t know anything about Silverlight, so I can’t tell if it’s a problem with the code or something else.

    BTW, I’d be interested in seeing a regular Flash withoutFlex demo.

    Comment by Aaron — August 13, 2007 @ 7:54 pm

  43. with 16 balls I had more than 360fps with SL (CLR) on vista ie7 and est. 280fps with fx2.0 (but moved over 330 by time).

    the others stayed below 70fps.

    (cpu: T2400 duo)

    Comment by FTeR — August 14, 2007 @ 10:59 pm

  44. […] I might be late to the party on this one, but someone sent this link around at work today and it’s definitely worth sharing.  Alexey Gavrilov has rebuilt the same animation/mini-app in all of the major RIA platforms that are in use today (DHTML, Flash, WPF, Silverlight, etc.) and published them for your analysis and viewing pleasure.  He’s also publish the perf results that he got when running the app in the various platforms.  His results were very different than what I saw on my machine, but still very interesting.  The results page also has a good (albeit long) discussion of the results that’s a worthwhile read. […]

    Pingback by notstatic.com — August 16, 2007 @ 9:03 am

  45. I tried remaking the Java version so that it does not cap the frame rate at 60 FPS - you may notice that the CPU load is really low.

    At 16 balls, The updated version gets 3000FPS on my 3-year old Windows XP desktop:
    http://soupgames.net/javaballs/java.html

    This is done (like the DHTML version) by moving the balls individually as GUI elements, so Java probably combines some of the graphics updates.

    To compare raw graphics update speed, here is version that redraws every ball to a buffer and redraws the buffer to screen: This reaches 900FPS on my desktop:
    http://soupgames.net/javaballs/javaawt.html

    Source for both, here:
    http://soupgames.net/javaballs/javaballs_noframecapv2b.zip

    Comment by Jesper Juul — August 22, 2007 @ 8:36 pm

  46. […] The results say, in Alexey Gavrilov words; “WPF runs faster than anything else. The unexpected is that WPF/e is faster than Flash despite the fact that it’s been in the market for years“. You can find the results comments here. Ah, WPF/E was the code name for Silverlight, before it was launched. […]

    Pingback by Silverlight Introduction… « silverlightguy — September 22, 2007 @ 8:27 pm

  47. I find in Flash that you need to have at least one pixel of transparency around any transparent PNG to avoid have a pixel being cut off

    Comment by daniel — October 14, 2007 @ 6:24 pm

  48. […] I came across a framerate comparison between Silverlight, Flash, Flex and DHTML that was done by Alexey Gavrilo. The comparison used a neat animation Alexey put together and ported to each of these languages for comparison - reveals some interesting results! […]

    Pingback by MC`s Sandpit » Blog Archive » Silverlight Collision Detection — October 19, 2007 @ 1:25 am

  49. Just to test that whether my website supports Silverlight application or not i downloaded your code and pasted it in my website wwwroot directory.but It was giving error “this._elem” object is null.

    What could be reason or solution to host Silverlight 1.1 application on a website.

    Thanks
    Ajit

    Comment by Ajit — October 29, 2007 @ 1:55 pm

  50. Oh, and did not know about it. Thanks for the information …

    Comment by Andy — December 19, 2007 @ 8:47 pm

  51. One of the biggest problems of new
    technology is not the coolness of the technology, but the possibility to utilize this technology in a productive wa (performance is only one aspect). To me the best reason for going with
    Silverlight 2.0 is of course being able to reuse my C#
    skills and experiences to deliver a cool interactive experience, before Silverlight I already know about Flex, and I already know about how powerful ActionScript can be if I took the time to delve into it. But that’s what I dont have.. time to learn yet another language. :P

    I would have to say that Flash is definetly the stronger animation tool right now since Blend is unable to do animation for Silverlight yet, but Silverlight is on familiar ground for me so that’s where I’m going to go.

    Comment by Mike Miller — May 15, 2008 @ 3:03 am

  52. Hi, I got amazed by the speed of the 500+ fps I got when running your Silverlight 2 test. I have downloaded the source code but, when I run it, I can’t get more than 62 fps.

    Am I doing something wrong?

    Comment by Julio Casal — May 19, 2008 @ 2:27 am

  53. Silverlight object has a parameter, called maxframerate, which is 60 by default. I set it to 1000 on the page on the site <param name=”maxframerate” value=”1000″ />. I’ll fix it in the downloadable code too.

    Comment by Alex — May 19, 2008 @ 11:04 am

  54. So just about everything I could get to run runs at about 60 - 65 fps for me, except silverlight runs at 500+ fps O.O !?

    I downloaded the code and ran it on my machine, low and behold, it drops down to ~65 fps, what’s going on here?

    Comment by Mikey — July 3, 2008 @ 10:55 pm

  55. Wow, I’m stupid, you already answered this. Thanks.

    Comment by Mikey — July 3, 2008 @ 10:56 pm

  56. Silverlight is more like FLASH than MICROSOFT.
    Microsoft bought over companies to release expression series and Silverlight range ofproducts. And guys behind these technologies have solid reputation in animation/ graphic worlds.
    So Silverlight will become a worthy competitor. ( I am more of Adobe/macromedia guy)

    Comment by Jack — July 18, 2008 @ 4:36 pm

  57. Flash is amazing and we have developed mission critical application also. Flash has limitation too as all development tools. Developer should find how to achieve the milestone. We did some research on XML data passing with flash & SQL Server. The result was unbelievable.

    I download silverlight and experimented. It is not bad. Good start from microsoft. But they are far far behind Flash. I hope they will improve it soon to compete the future client side development. My recommendation is for beginners to follow Flash and flex until Microsoft release strong silverlight.

    Comment by M. Frei — July 18, 2008 @ 4:38 pm

  58. Unfortunately, this test has a lot of problems.

    http://www.craftymind.com/2008/04/11/why-bubblemark-is-a-poor-ui-benchmark/

    Comment by Aaron — July 24, 2008 @ 8:01 pm

  59. Can somebody please comment on Jesper Juul’s updated code of the Java version getting 3000+ fps?

    In light of this, can anybody tell me seriously why Java Applets are not a serious contender for RIAs? Java can do everything that Flash can do, plus the entire Java API library. I’m not talking about the user-base, I’m talking purely in terms of performance.

    Awaiting responses. Cheers.

    Comment by Navigateur — August 15, 2008 @ 7:25 pm

  60. MacBook 2.2 with 4 GB RAM GHz, running Vista

    DHTML - 66 fps
    WPF/e - 68fps
    Flex - 67 fps
    WPF - 74 fps

    Comment by Vineet — August 22, 2008 @ 4:38 pm

  61. Hello guys.
    I’ve downloaded silverlight and wpf code and with few changes got thousands of fps. 3000+ for 16 balls on silverlight. I think the same would be on java.
    Your drawing engine is poor. You have to use separate thread like this:
    void EngineThread()
    {
    while (isRunning)
    {
    Interlocked.Increment(ref framesPooled);
    Dispatcher.BeginInvoke(() =>
    {
    moveTick(this, EventArgs.Empty);
    Interlocked.Decrement(ref framesPooled);
    });
    // uncomment to make it slower
    // Thread.Sleep(6);
    while (framesPooled > 50)
    {
    Thread.Sleep(10);
    }
    }
    }

    Dispatcher.BeginInvoke puts our move calls into main queue and silverlight will process them one by one. One thing we need to take care of is putting too many calls into queue - that’s why i’ve added this incrementing stuff.

    Comment by Dima — October 20, 2008 @ 2:28 pm

  62. I have a flash website
    i’m looking for the script who makes google ads in flash.
    where can i get it?

    Comment by HSCharles — November 15, 2008 @ 7:47 pm

  63. I had some surprising results:

    Results:
    [Firefox 3 - 16 Ball Test]
    DHTML - 88fps
    Flex - 140fps
    Flex (Cached) - 198fps
    WPF - 96fps
    WPF/e - 208fps

    Comment by DGDev — November 21, 2008 @ 12:39 am

  64. Hi

    We have made another way to compare speed tests of code running on the CPU.

    Please check it out here:
    www.3djam.com/Speed_demo.aspx
    (it show similar result to the bubblemark test)

    Soon we want to make the bubble mark test in C++ and C# for Roozz plugin.
    However running it from the www.bubblemark.com require a server license,
    thus we suggest that you run it from our server and simply link to that page on our server.
    Will this be OK with you?
    Will you add it to the list?

    /Thomas

    Comment by Thomas — May 16, 2009 @ 10:48 am

  65. Silverlight (WPF/e) 3.0 got fps around 550

    Java Pulp Core can animate one ball just under 4000 fps, however when it comes to 8 balls, fps drops below 400.

    Comment by warlock — January 5, 2010 @ 6:17 am

  66. I believe with optimisation all of these technologies, Java, Flash, Silverlight, Javascript can achieve much higher fps. For example, Flash is capable of directing 1000 individual objects with collision avoidance, and at smooth rates (24fps i think).

    Comment by Cardin — September 2, 2010 @ 3:09 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment