And it runs how fast? Not a comparison, nor a test. Plus this isn't about C++, remember?
Printable View
And it runs how fast? Not a comparison, nor a test. Plus this isn't about C++, remember?
How about something quite simple then which mixes algorithms and graphics work.
Such as a SuDoku solver.
I know I've got a VB6 one somewhere, and I'm certain it's been done to death on both platforms. I even have a 16 by 16 Su Doku which It took me about 4 hours to solve manually (there is a point where only one square can be filled...)
Yeah I know it isn't about c++, but I thought I told you why I made it. Although I do find c++ to be an alternative against the .net in whole
Well if you wanted a comparison:
Vb6 with 10000000 with method 2 was 12750 ms
c++ with 10000000 with method 2 was 2125 ms
Now the only slow down is that stupid api.
Also we are doing a speed test, so why not throw in c++? It will be fun!
For C++ test to be fair, we need also to subject it to the graphics test.
I've no doubt it'll be faster (the language structure is better designed), so who really cares? I suspect very few people who are proficent in c++ would chose to write in any form of VB when speed is an issue.
I agree with you there, but we are doing a speed test. If people don't want a c++ conversion, I won't bother, but I did what to demonstrate c++ against vb6 and the .net when speed is measured. As you can see I can write about 6x as much code in c++ until I hit the same speed in the vb6. So I am very curious to see how it benches out to vb.net. This is more of a personal thing. It doesn't have to be vb6 vs vb.net vs c++. It can just be vb6 vs vb.net. I just thought of c++ when I heard speed ;)
I hope that you dont mind but i moded it a little, and placed a listbox on the form.. and each test placed the time into the list.. (So i have a running list of times..)Quote:
Originally Posted by WizBang
Only change wasThis gives us Times on multiple runs..Code:Me.Caption = T
Changed to
List1.AddItem (T)
Results ... As normal VB6 Left, VB.NET right...
Run 1 (Unchecked) : (K = K + 1)
http://i141.photobucket.com/albums/r...other/Run1.jpg
Run 2 (Checked) : (full Calculations..)
http://i141.photobucket.com/albums/r...other/Run2.jpg
Attached is my VB.NET project...
So clearly there must be other benefits to using VB6 other than pure speed; otherwise everyone would be coding in C++.Quote:
Originally Posted by Joeman
Given that, do these speed comparisons really matter? Or is it all the other features that go into an programming environment (i.e. VB6, VC6, .Net, etc) what make it compelling enough to be the environment of choice?
I was just keeping with the speed ideal
I like the speed test gremlinsa. I am suprised the .net won on my machine against vb6. I don't know how, but it did. :)
Here are the timings I got for 10000000:
for method 1:
vb6 - 246ms
vb.net - 141 ms
c++ - 15ms
for method 2:
vb6 - 10062 ms
vb.net - 8172 ms
c++ - 1766ms
So now how fast is this in percent?
vb.net is 1.23x faster than vb6. This isn't much but this is something
vb6 runs only 0.8x the speed of the vb.net version
now for c++ ;) this is just for fun
c++ is 5.79x faster than vb6
c++ is 4.67x faster than vb.net
I really liked this test! :D
This is very interesting Gremmy!
So, what do you suppose accounts for the differences between the differences? LOL I mean, the .net version is about twice the speed this time, whereas drawing boxes was relatively close.
I intentionally put the CheckBox in the loop to see how fast the object itself was being accessed. I just tried storing the value of the CheckBox in a variable, and as expected, that was faster. So let's try the same for the .net version, to get an idea of the difference between accessing objects, and accessing variables. New code attached (and I like the ListBox idea).
We need to do a direct comparison of how fast data is added to a ListBox in order to subtract that from the loop time to get the execution time of the code we're testing.
This code should port directlyish - it's simple enough :p
No, that doesn't happen until after the time is taken, so it doesn't effect the test.Quote:
Originally Posted by javajawa
My apologies, you are, once again, correct.Quote:
Originally Posted by WizBang
I took the ideal to use a lisbox to see how fast vb6 and vb.net can populate the listbox.
Now I know I am not the best .net coder. I didn't try to use the slowest methods either. vb6 to vb.net looks exactly the same except for a couple lines that needed to be changed.. for ex listbox.additem to listbox.items.add
The Project is attached. This populates the listbox with "abc" ;).
The results are:
vb6 - 907 ms
vb.net - 2218 ms
I didn't do anything to trick you. I did hide the listbox because it is much faster to populate like that. I did it for both. Feel free to correct any of my mistakes if there are any
Both vb6 and vb.net projects are attached