Flow Benchmark:

Unit in seconds - Smaller is better - you should consider a difference of 10% or less as negligible.

Flow.gif

Analysis of the results:

In all cases, CrossNet and C++ is fatser than .NET 2.0 by a significant number on flow benchmarks.
  • List:
    • CrossNet is almost 2 times faster than .NET 2.0 here.
    • I didn't look at the generated assembly code here but it could be a better inlining / pipeline scheduling.
  • Nested loops:
    • CrossNet and C++ are much faster than .NET 2.0 here.
    • This is clearly a demonstration of goodness of the C++ optimizer (granted that's a specific case).
    • The optimizer is able to completely unrool one level of a loop, and get the correct operation result.
    • Note that I had to tweak the C++ benchmark a bit so it did run some code (otherwise the optimizer completely removed the code as it knew the result of the first execution!).
  • Recursive calls:
    • CrossNet and C++ are 30% or so faster than .NET 2.0.
  • Virtual calls:
    • CrossNet and C++ with the same timing, and 25% faster than .NET 2.0.
    • That was a big surprise to me as I would expect all three implementations to return the same result.
    • Note that in real case with more cache misses, this might not be true anymore.
  • Interface calls:
    • CrossNet is almost 20% faster than .NET 2.0.
    • That was an even bigger surprise to me as I thought that my interface implementation would be significantly slower than .NET 2.0 (by more than 20%).
    • Especially given that .NET is at advantage with the JIT able to hardcode the Interface ID.
    • CrossNet has to currently read the interface ID (I actually get the interface map, then the interface ID, I could actually be slightly faster).
    • So I guess I won't change the current interface implementation, especially given that it's C++ friendly (my other alternative would be easy to generate / hard to maintain).
    • Note that in real case with more cache misses, this might not be true anymore.
    • An interesting point is that the ratio between virtual call and interface call on CrossNet and .NET 2.0 is the same (around 15% slower).

Last edited Sep 16, 2007 at 5:44 AM by OlivierNallet, version 5

Comments

No comments yet.