|
|
Comments and Discussions
|
|
 |
|

|
Hello there,
I am currently working in .net. Now i need to know that in order to build a server/client architecture which one is more suitable Vc++ or .net. There is a server in our company that has been build over vc++, now we are looking for any chances of shifting it to .net. BTW speed of delievering messages and other networking efficiency issues are very important. So, cud u give me any advice on it, or tell me performance comparison of vc++ or .net.
Thanks in advance..
Cheers.......
Bye
Nothing Is Impossible In Life
|
|
|
|

|
(MCPP / VBNET/ C#) the performance impact on accessing the db.
Abhi
|
|
|
|

|
In Longhorn the API is not in C but in DONNET aware langauge.
Does anyone know what will be the result in Longhorn?
Thanks in advance
Oren.
|
|
|
|

|
when using ngen, do you still have to have the .NET framework installed on a client machines?
|
|
|
|

|
Dear Anonymous:
ngen.exe only creates an 'pre-compiled' image in cache, not an .exe that you can then run on a computer without the framework installed. You still need the framework to run it, it's just saving you the JITing time.
Also dont forget to read my first CP article: http://www.codeproject.com/dotnet/dnlp.asp[^]
, Keep Smiling.
Rai Umair
What is now proved, was once only imagened...
|
|
|
|

|
I was rather disappointed.
So we're looking at performance of languages. The signal is the execution time of the test code. The noise is the overhead from COM interop, etc.
For small test sizes, i.e. small number of primes, the noise outweighs the signal. This makes the tests completely useless at this level.
For the large test, the difference between tests is no more than 1%. We don't know how the overhead affects the results on this scale. Once again, the tests are pretty useless.
There's one small exception: the VB.Net code is 3-4% slower. But this may be due to language-specific constructs. The use of the ReDim statement comes to mind. ILDASM is the tool of choice here: see what code the compiler generates.
A more valid test would be to have the entire test code, including the timing code, written in the language. That will minimize overhead.
Jeffrey
Everything should be as simple as possible, but not simpler. -- Albert Einstein
http://www.extremeoptimization.com/
|
|
|
|

|
I upgraded this to vs.net 2003 and the ngen numbers were almost identical in the extended tests. VB6 was the fastest in the extended tests.
ATLPrimes 10 33 738
VBPrime 10 111 2644
CSharpPrimes 10 4028 3162
CSharpPrimes (ngen'd) 10 10492 3225
VBNetPrimes 10 4495 3804
VBNetPrimes (ngen'd) 10 4633 5208
MCPPPrimes1 10 7049 4456
MCPPPrimes1 (ngen'd) 10 5303 4498
MCPPPrimes2 10 8389 9353
MCPPPrimes2 (ngen'd) 10 8520 7751
ATLPrimes 1000 7321 7995
VBPrime 1000 5067 6051
CSharpPrimes 1000 10346 9541
CSharpPrimes (ngen'd) 1000 10185 9504
VBNetPrimes 1000 79723 25387
VBNetPrimes (ngen'd) 1000 25531 25144
MCPPPrimes1 1000 13642 11275
MCPPPrimes1 (ngen'd) 1000 12043 12935
MCPPPrimes2 1000 31226 29267
MCPPPrimes2 (ngen'd) 1000 32183 30623
ATLPrimes 100000 3664678 3751235
VBPrime 100000 2441960 3006081
CSharpPrimes 100000 3320130 2919183
CSharpPrimes (ngen'd) 100000 3364131 3105973
VBNetPrimes 100000 5443152 5907290
VBNetPrimes (ngen'd) 100000 5262887 5847501
MCPPPrimes1 100000 2802521 2794613
MCPPPrimes1 (ngen'd) 100000 2952759 2825932
MCPPPrimes2 100000 5890069 5385754
MCPPPrimes2 (ngen'd) 100000 5928540 5482403
|
|
|
|

|
I think the test was too simplistic to draw any conclusions for 'real world' applications.
However, it does show that if you're doing serious number crunching, there is very little difference with large working sets, and an insignificant difference with a small working sets.
One big advantage of managed code is that memory allocation is MUCH faster. In C++, new/delete are very expensive operations. With .NET code new is almost as efficient as allocating stack space and garbage collecting lots of objects at once requires less time than deleting lots of objects manually one by one.
In most applications, I think you'll find the speed of dynamic memory allocation/deallocation a more important benchmark .
|
|
|
|

|
Has anyone bothered to look at the source code ? Not only does the author have the VB.NET project set to incremental build, but also has option strict off, optimizations off, and uses non short circuiting operators (And instead of AndAlso) inside the loop test, whereas for the C# project the author has set the complete opposite. For the C# he has incremental build off, optimizations on, and uses short circuiting operator (&&)
I fixed the code, changed the order of the tests, and ran multiple tests in he same run, that is 10, 100, 1000, 10000,10, 100, 1000, 10000,10, 100, 1000, 10000, etc all in the one run. Why you may ask ? Well the calling code may get optimized slightly differently or behave differently as new libraries are being loaded and as the JIT occurs. Most importantly running repeated tests in the one run simulates more what we are likely to see when running web services or asp.net applications.
The results interestingly enough were vastly different from the author's claims. In fact, the VB.NET code out performed the C# on many occasions, but likewise so did the C# code. These variations/fluctuations are most likely due to garbage collection.
Furthermore to put this code all into perspective, it's important to note that there is significant COM overhead. The difference can be seen if the managed code is called directly rather than through an interface.
Finally, one important aspect seems to be over looked. The author is testing only specific parts of the language functionality. In particular he tests a couple of math functions. Obviously if code does not perform safety tests then lower level code will perform bests on these kinds of tests as these are aimed at series of processor instruction codes that are often built in these days. A more realistic test would be something that most business do everyday such as string processing, or perhaps the rendering of a web page etc.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This article compares and contrasts the relative performances of various languages like native C++, Visual Basic 6, C#, VB.NET, Managed C++, MC++ and native code mix, ngen'd assemblies etc. using a prime number generation function as a generic benchmark
| Type | Article |
| Licence | CPOL |
| First Posted | 8 Aug 2002 |
| Views | 248,378 |
| Bookmarked | 43 times |
|
|