John Walkenbach has a post comparing peoples processor speed here. If you havent added yours please do so, especially if you have a monster machine.
I duly did the tests and posted my results. Mathius did the equiv code in C#, so of course I had to fire up C++. It ran in about 2.7 seconds compared to 13.7 in VBA. No surprises there right?
So then I fired up my beloved VB6 – 19 Seconds! WTF??? I did all the optimisations and got it back down to 15.something. But why would a VB6 exe be so much slower than VBA?
If you have VB6 perhaps you could run your own check in case I’m doing something dumb. It took me ages to realise/remember that VB6 doesn’t have separate debug and release builds (too long in VC++)
Double bizzaro, if I debug in VB6 i get 13.odd, if I build the exe and double click that I get 15 or so.
Why would the compiled version be slower than the debug version?
I tried it as a dll too and VBA is still faster.
I know recent VBAs use slightly different libraries, but I thought they all went through the same MSVBVM60 runtime? Maybe this test doesn’t need that runtime from VBA?
I don’t want to spend much time on this, VB6 is pretty much an ex-parrot at this stage, but anyone has a plausible answer off the top of their head please leave a comment.