Processing speed

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.



7 Responses to “Processing speed”

  1. Harlan Grove Says:

    VBA runs in 10+ sesconds. FTHOI, equivalent gawk script runs in 20+ and absolutely stripped down C (an old gcc version) runs in under 2 seconds.

    Not quite the same thing, but the stats package R (ver 2.10.0) runs

    x = runif(1e8)

    in about 10 seconds. I may not do the comparisons and arithmetic, but it allocates an array of 100 million usable entries. I’d like to see how long it took any MSFT flavor of BASIC to load an array of just 1 million reals.

  2. Ross Says:

    Did you test on the same PC:-)

  3. Dick Moffat Says:


    Sorry I have no experience or anything to cointribute on this topic (which I’m sure is important to your usual readers) but I sure liked the “VB6 is pretty much an ex-parrot at this stage, ” reference ….. Very funny.

    I have been travelling a lot lately and met a German who joked “Don’t mention the war !!” and bonded with several of you Brits over “F**k off I’m full” (which was also referred to by a middle-aged waitress at a country restaurant here in Canada recently).

    Python is the universal language of the intelligent world (of a certain age :-))…

    Hope this doesn’t kidnap your thread here ….


  4. Al Gill Says:

    At the risk of kidnapping the thread, at a wedding in the Czech republic (Italian and Czech being the only languages spoken) the bridesmaids taught me to sing ”Always look on the bright si-ide of life” in Czech….off to run some code…..

  5. Simon Says:

    I find the odd python ref hints at an air of sophistication unmatched by quoting my real hero Roger Mellie:,arts,roger-mellie-goes-on-im-a-celebrity-get-me-out-of-here

  6. Dick Moffat Says:

    That looks great and SOOO sophisticated too :-) …. I might look into that some more.


  7. Marcus from London Says:

    While Roger Mellie might wear one, as I come from the Land Down Under, I can assure you that no one – repeat no one – wears corks hanging around the brim of their hat.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: