|
-
Mar 12th, 2002, 04:31 PM
#1
Thread Starter
Junior Member
Is VB.Net really as slow as this...?
okay,
as some may have noticed, i started the thread on performance timers... which is now sorted. But having got it sorted, my time comparisons are a little *bad* as you can see:
okay, first up - test machine:
700mhz Athlon Thunderbird / 288mb PC100 RAM (ie, not slow!)
I'm testing the maths/memory manipulation type things w.r.t. using VB.Net for high performance (okay, i know it aint top-of-the-line) multimedia/graphics work... thus speed is critical.
here are my results:
MATHS FUNCTIONS:
in order: sqrt, sin, arccos, arctan
(times in nanoseconds)
VB6 | VB.Net | VB.Net is...
=======================================
281.8882 | 630.0195 | 123.5% slower
265.1841 | 665.9771 | 151.14% slower
883.1846 | 1041.6985 | 17.95% slower
326.3383 | 927.4561 | 184.2% slower
MEMORY MANIPULATION:
in order: alpha blend test, memory addition
(times in milliseconds)
VB6 | VB.Net | VB.Net is...
======================================
20.7814 | 80.5359 | 287.54% slower
104.9186 | 155.8228 | 48.52% slower
okay, the VB6 code and VB.Net code is pretty much identical (as much as is possible). VB6 code is using the most optimized native compile as possible (for speed). VB.Net is just set to the "release" configuration and run through windows (not with debugger attached)...
Please tell me I'm missing something really obvious with respect to speed-compiling a VB.Net program - these results are awful! IT HAS TO BE MY FAULT!!! 
can someone give me good reason to kick myself and make VB.Net run a little bit faster 
Jack;
-
Mar 12th, 2002, 04:57 PM
#2
Thread Starter
Junior Member
should anyone want to double-check my code/methods:
http://www.vbexplorer.com/directx4vb...erformance.zip(31kb)
is the code (VB6 and .Net) that i used.
Jack;
-
Mar 12th, 2002, 06:55 PM
#3
Frenzied Member
Is this running out of the IDE or compiled? Benchmark the exe, not a debugger.
-
Mar 13th, 2002, 05:06 AM
#4
Thread Starter
Junior Member
VB.Net is just set to the "release" configuration and run through windows (not with debugger attached)...
- from my first post.
unless there is something wrong with "building" the solution using the release configuration, closing VS.Net and navigating to the correct folder and running from there - then this is from compiled .EXE times!
read the post next time 
Jack;
-
Mar 14th, 2002, 04:23 AM
#5
Lively Member
Jack, your methods look okay to me. I didn't time it as you have, but I am running VS.NET on a pIII/1Ghz/128mb/Win2k pro machine, and it seems to me that my VB.NET compiled programs are MUCH slower than their VB6 counterparts. If you need backward compatability with slower computers, you're probably pretty much screwed
Aww screw it. I didn't really want to fool with it anymore anyhow.
-
Mar 14th, 2002, 04:41 AM
#6
Addicted Member
that's quite worrying! i thought VB was now meant to be on par with C++...
-
Mar 15th, 2002, 07:43 AM
#7
Thread Starter
Junior Member
-
Mar 15th, 2002, 10:37 AM
#8
Lively Member
All Managed code gets compiled to MSIL, including Managed C++. You probably mean NGen.exe by "special extended program", NGen indeed compiles the MSIL code to x86 code. This is obviously not only for C++, NGen doesn't even know from which language the MSIL was generated (VB or C# etc.).
The first time when you invoke a method of a Managed App (without NGen'd before) is always slower because it has to be JITed first.
Are you perf results the same when you run the test a couple of times, without closing the App ??
And how is perf when you NGen your App first ??
-
Mar 15th, 2002, 05:22 PM
#9
Thread Starter
Junior Member
I haven't seen this "NGen.exe" yet, so I'll have a look into it... thanks for pointing it out..
Is there info in the help libraries about it? or do you have to work it our yourself?
As for the JIT'ing / running the tests several times - I set the program to do 100 loops for each test (thus, if it's cached the JITed code it may speed up), however, I did get a slight speed increase - but nothing worth talking about, and it only kicked in after 2-3 executions, and didn't improve after that (it went from ~630 -> ~600 nanoseconds)...
Jack;
-
Mar 31st, 2002, 12:17 AM
#10
Member
Can someone please tell me where this "NGen.exe" is located?
Thanks. Lance
-
Mar 31st, 2002, 03:18 AM
#11
Lively Member
c:\<WindowsDirectory>\Microsoft.NET\Framework\<Version>
For example:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3423
Or launch the "Visual Studio Command Prompt" from the menu and run ngen from the commandline: ngen <enter>
-
Apr 1st, 2002, 12:41 AM
#12
What version of Windows you got on there, pre- Win2K slows everything down
-
Apr 1st, 2002, 09:09 AM
#13
Thread Starter
Junior Member
tested on a Win98 system, but developed on a WinXP system - the times quoted are from the XP system....
anyway, if it's really slow on 98 (one of the most widely used OS's still) then thats still points against. I only assume that people are upto Win98 or above, I only wont support Win95 (it sucks now)..
Jack;
-
Apr 27th, 2002, 04:30 AM
#14
New Member
I read an article from Eweek on database benchmarking. They tested MySQL, Oracle, all the big hitters. Well, they said that a combo of MS SQL, ASP.net using VB.net, and IIS 5.0 served up 873 pages per minute.
Since ASP.net has to go through the JIT compiler, since its not pre-compiled, thats gotta be slower than pure VB.net. Therefore, i'm guessing that VB.net still has performance advantages. BTW, the StringBuilder class is much faster than the String class
<< IF YOU WORK FOR MICROSOFT OR KNOW WHAT YOUR TALKING ABOUT, I LOVE YOU >>
-
Apr 27th, 2002, 11:39 AM
#15
Since ASP.net has to go through the JIT compiler, since its not pre-compiled
From what I understand, it only goes through the JIT once, the first time. After that, the compiled version is from then on used. ASP.Net code is compiled though. It runs pretty fast too.
-
Apr 29th, 2002, 10:08 AM
#16
Can you check your link. I'm getting a page not found when I try to download your code.
-
Apr 29th, 2002, 04:06 PM
#17
Thread Starter
Junior Member
hmm, I'll sort it out later - the file isn't there due to the recent move from the VBExplorer.com server (now dead) to the Planet-Source-Code.com / Exhedra.com Server (my new home)...
Jack;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|