Re: Enlighten me - Mac vs. PC processing speeds



c1802362@xxxxxxx wrote:
Can anyone enlighten me on the fundamental difference why the same VBA
code runs at such different speeds on Macs vs. PCs?

Here's an example. I wrote some code months ago on my PC at work (Dell
1.73GHz/504 mB RAM/Windows XP). The task involved transposing 4000+
data records from a columnar listing to a tabulated format. The source
data was comprised of column A which listed the label name of each
field in the record. Column B carried the corresponding data for each
field. Between each record there was a blank cell, so each record's
field labels were repeated in column A. The only other nuance was that
each record did not carry the same number of fields, so I had to code
the macro to read to the end of each record in column B before copying
and transposing it to the table. I accomplished this by creating a
loop that read the data in each field into an array until it reached a
blank cell, then created another loop to write out the array to the
table. On the PC it took about 2 minutes 30 seconds to complete the
task.

I took the code home to run the same file on my Mac (iMac G5 1.8 GHz/
1GB RAM/OS X 10.5). It took more than 8 hours to run the same code!

A few weeks ago, I recoded the macro to make the task more efficient.
This time around I used 'Range(ActiveCell,
ActiveCell.End(xlDown)).Select' to grab the entire record at once
before transposing it to the table. Now the PC version runs in under 3
seconds. The Mac takes 2 minutes and 20 seconds.

Can someone explain what is inherent in the Mac that doesn't allow it
to process code as fast as the PC?

Art

Hi Art,

If you go into the Visual Basic Editor (VBE) and step through the code by pressing F8, are is there a particular command or operation that takes a long time to execute?

If so, can you post the offending code snippet here? Sometimes people know alternative methods that can be faster and they can post their suggestions in the newsgroup.

-Jim

--
Jim Gordon
Mac MVP

MVPs are independent experts who are not affiliated with Microsoft.
http://mvp.support.microsoft.com/
.



Relevant Pages

  • Enlighten me - Mac vs. PC processing speeds
    ... The task involved transposing 4000+ ... then created another loop to write out the array to the ... I took the code home to run the same file on my Mac (iMac G5 1.8 GHz/ ...
    (microsoft.public.mac.office.excel)
  • Re: Enlighten me - Mac vs. PC processing speeds
    ... code runs at such different speeds on Macs vs. PCs? ... The task involved transposing 4000+ ... then created another loop to write out the array to the ...
    (microsoft.public.mac.office.excel)
  • RE: Compare two text streams
    ... outer loop to reopen it each time the loop executes. ... files with mac addresses. ... Set objFSO = CreateObject ... Set objTextStream1 = objFSO.OpenTextFile ...
    (microsoft.public.scripting.vbscript)
  • Re: Ruby is Running Slow on Mac OS X
    ... My mac is new, ... I have it on a loop, and on average it took 10-30 ... One thing I observed on upgrading to Leopard (see ... use WPA instead of WEP encryption. ...
    (comp.lang.ruby)
  • RE: Arrays, Got Me Confused
    ... Thanks for that Tim and Steve, ... Basically I'm trying to create a class that contains an array of MAC ... Python has two central datastructures ...
    (comp.lang.python)