I've just run the same test as you, both with the listbox visible and hidden. I was very careful about form and control sizes for the visible one, so that the paint region was the same. I've taken averages across a number of runs (as this thing is becoming slightly jerking due to encoding mp3s...)
It was all done form a Compiled exe. Not using the debugger.
Results:
Visible:
Vb.Net: 156ms (ranged from 110 - 172, including 5 172s out of ten runs)
vb6: 106ms (range 78 - 165, including 4 94s out of ten runs)
Hidden (NOTE: NOT THE SAME NUMBER OF RUNS!)
Vb.net 528ms little range
vb6 I got bored after about 30seconds...so one run was 38953.
Help from me is always guaranteed!*
VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.
No problem. Could you download the listbox_speed.zip and run them both compiled without any modification, so we can get a more solid ground on results. EDIT: I want you because I did modify code a bit, so your code is no longer the same size on both the gui or coding wise
Last edited by Joeman; July 22nd, 2008 at 02:54 PM.
okay so i did much the same for the Sorting Algo's...
I did a quick rewrite of the VB6 code into VB.NET, and the results are some what interesting....
VB6 left, VB.NET right...
NOW... Some notes...
1) The sorting is done directly within the Listbox...
2) None of the code has been optimised..
3) Sorting times are also dependant on how out out of sort the array is, and it's a little beyond thescope of this test to try and give both test apps the same list..
Anyone care to interpret these results, and perhaps tweek the code...
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.
What i've been thinking is that .NET has an Updated maths object, something a lot faster, taking advantage of some of the new Chip features..
For example, VB6's "K = K + 1" can be translated to "K += 1"...
The VB6 code has been pretty much tweeked, short of sorting in the Listbox. This was done on purpose, to enable the 'display sort progress', and a few other things...
Care if I add a speed test of mine? It's pure calculation and the results are pretty interesting. Now, see if you can tweak some compilation parameters or some code parameters and even the things out. Maybe testing with the unsafe keyword (for the c# app) could make things faster?
Anyway, the .zip file include the code for c++, vb6, c# and vb.net and the results I got on my computer. Do you get similar results?
What i've been thinking is that .NET has an Updated maths object, something a lot faster, taking advantage of some of the new Chip features..
For example, VB6's "K = K + 1" can be translated to "K += 1"...
That's about all I can figure...
I was wondering about that, but also about the speed of the graphics object that you used in the .net version for drawing the squares. Perhaps the more graphics work the code must do, the slower .net would become relative to the VB6 code using API.
So it might prove insightful to test a routine which checks the properties of a bunch of controls, such as buttons, checkboxes, dropdowns, etc. As long as it doesn't change any properties, the controls won't need to be redrawn, so it should give some idea of how efficiently the objects are accessed.
But, before I write that, I'll post the sorting test I slapped together earlier. This uses BubbleSort, and the CheckBox determines whether the array to be sorted is numeric or string. (the original button and code is still there too). A ListBox is included to show multiple test results.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Indeed.
Having now worked with both, I really think a VB7 might STILL be needed. The only features of .NET i've liked are Docking and the proper classes. Oh, and the ability to (if a bit messily and difficultly) deal with pointers. None of these, however, rely on the .NET framework...
Help from me is always guaranteed!*
VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.