Brooke
Thu Aug 24 14:28:28 CDT 2006
I have been doing some raw speed testing between CF1, CF2, C#, and VB.NET.
In the process, I found a project that I converted from native C to C# a
few years ago and I decided to add it to mix. The app loaded instantly on
my PPC-6700 while the .net app took four seconds to load! I was able to
open the native C app, do the updates, and close it before the .net app even
opened. I then wrote a native C Towers of Hanoi app so that I could include
it in my performance analysis and I came up with some interesting results...
VB.NET is much slower using the 2.0 framework than it was on the 1.1
framework, both on the desktop and on the compact framework.
C# is faster on the 2.0 framework, both on the desktop and on the compact
framework.
Native C code smokes all of the .NET framework apps.
I know that there is a trade off between development time and performance,
and native code definitely requires more development time, but the
performance is so much better.
I am in the process of rewriting about 20 compact framework application.
The rewrite it going very smoothly as all of the .net apps were written in
C# and it is easy to make the minor modifications as required. I also had
to use a lot of interop calls in the .net apps because of the limitations of
the compact framework where it is just a simple API call in native C.
I am still going to use the .net framework for my ASP.NET development and
any major database applications.
Posted below are some of the results.
Compact Framework 1.0 - Towers of Hanoi
25 Discs 28 Discs 29 Discs
---------------------------------------------------------
C# 11.094 secs 90.264 secs 176.711 secs
VB 10.363 secs 81.298 secs 162.115 secs
Compact Framework 2.0 - Towers of Hanoi
25 Discs 28 Discs 29 Discs
---------------------------------------------------------
C# 9.928 secs 78.868 secs 158.123 secs
VB 13.586 secs 108.533 secs 216.583 secs
Native C 3.967 secs 31.697 secs 63.619 secs
"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
news:OeXJjq6xGHA.3552@TK2MSFTNGP02.phx.gbl...
> I'd disagree on this. If it's slow it's because implementation is poor.
> JITted C# is just as fast as compiled C++ when the source it written
> properly.
>
>
http://msdn.microsoft.com/library/en-us/dnnetcomp/html/jittedcode_cf2.asp?frame=true
>
> --
> Chris Tacke
> OpenNETCF Consulting
> Managed Code in the Embedded World
> www.opennetcf.com
> --
>
>
>
>
> "Mike Margerum" <junk@mail.com> wrote in message
> news:%23ljy2X6xGHA.2384@TK2MSFTNGP05.phx.gbl...
>> or that C# is slow as a dog on a 300mhz arm processor
>> Mike Edwards wrote:
>>> My guess would be that it's still used because there's a massive base of
>>> developers used to developing in Win32 and MFC native code, whereas CF
>>> is relatively new and therefore is still being learned. The installation
>>> of the CF is probably also a factor - it was always a real pain for my
>>> customers to have to install evb runtimes when they stopped being
>>> included in newer
>
>