Dual Core Processors

B

Bill Martin

Using Excel 2003, I have a VBA speed test I wrote which takes about a minute
on my old Celeron XP-Home system. And if I watch CPU usage while it runs,
Task Manager sits pegged at 100% while it runs which is what I expect.

I just ran it on an AMD X2 4200 though with XP-MediaCenter which runs it in
half the time. What surprises me though is that Task Manager tells me that
*both* CPUs run at about 50% each when the program runs. What I expected
was to see one CPU pegged out at 100% and the other loafing along doing
nothing.

Is Excel 2003 written to take advantage of dual core? I didn't think it
was. And if it is, why does it only drive the CPUs at 50% rather than 100%?

Thanks...

Bill
 
B

Bob Phillips

I don't think Excel is, but don't forget, lots of the work is off-loaded to
the OS. It is probable that Excel is running in one, the OS tasks in
another.

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Bill Martin

No, that doesn't seem to be the case. I have nothing else running on the
machine, so the CPUs are loafing along at under 2% until I hit the button to
execute my VBA. At that point they both jump up to around 50%.

And I can't believe the computer is smart enough to send off to two CPUs the
VBA I wrote even if it could do so. There is no spreadsheet recalc or
anything going on, just a single thread of numerically intensive
calculation.

Bill
---------------------------------------------------------------------------------------------
 
B

Bob Phillips

That isn't what I suggested.

When the VBA executes, all of the pure VBA will be in one processor. But it
isn't all done internally within VBA, some things will be handed off to the
OS to do, it is this that I am suggesting may well be the another processor.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Bill Martin

Hmmm... I've got a friend with a dual core Intel setup so I guess I'll ask
him to try it on his machine to see what he gets. As the VBA is
specifically written for a speed test it does absolutely nothing but
arithmetic calculations and every few seconds it touches the Excel status
bar to post its progress. No disk usage or paging or display usage or
anything I can think of that should use OS support.

Thanks Bob.

Bill
--------------------------
 
B

Bob Phillips

You wouldn't think so, but I bet there are hundreds of calls in makes in all
of those tasks.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
N

Niek Otten

<every few seconds it touches the Excel status bar to post its progress>

That's one of the many tasks you leave to the OS; presentation.

On my Pentium4 system (Hyperthreading, not real dual core), if I run VBA to do multiplications in a loop, the task manager sees
two processors. Excel takes 50% of the available CPU (that is one full thread) and System Idle Process takes the other half.
Running a worksheet-intensive file in Excel 2007, which does benefit from multiple CPUs or threads (but not in VBA), I see the
Excel process going up to 70% and sometimes more.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


| Hmmm... I've got a friend with a dual core Intel setup so I guess I'll ask
| him to try it on his machine to see what he gets. As the VBA is
| specifically written for a speed test it does absolutely nothing but
| arithmetic calculations and every few seconds it touches the Excel status
| bar to post its progress. No disk usage or paging or display usage or
| anything I can think of that should use OS support.
|
| Thanks Bob.
|
| Bill
| --------------------------
| | > That isn't what I suggested.
| >
| > When the VBA executes, all of the pure VBA will be in one processor. But
| > it isn't all done internally within VBA, some things will be handed off to
| > the OS to do, it is this that I am suggesting may well be the another
| > processor.
| >
| > --
| > ---
| > HTH
| >
| > Bob
| >
| > (there's no email, no snail mail, but somewhere should be gmail in my
| > addy)
| >
| >
| >
| > | >> No, that doesn't seem to be the case. I have nothing else running on the
| >> machine, so the CPUs are loafing along at under 2% until I hit the button
| >> to execute my VBA. At that point they both jump up to around 50%.
| >>
| >> And I can't believe the computer is smart enough to send off to two CPUs
| >> the VBA I wrote even if it could do so. There is no spreadsheet recalc
| >> or anything going on, just a single thread of numerically intensive
| >> calculation.
| >>
| >> Bill
| >> ---------------------------------------------------------------------------------------------
| >> | >>>I don't think Excel is, but don't forget, lots of the work is off-loaded
| >>>to
| >>> the OS. It is probable that Excel is running in one, the OS tasks in
| >>> another.
| >>>
| >>> --
| >>> HTH
| >>>
| >>> Bob Phillips
| >>>
| >>> (there's no email, no snail mail, but somewhere should be gmail in my
| >>> addy)
| >>>
| >>> | >>>> Using Excel 2003, I have a VBA speed test I wrote which takes about a
| >>> minute
| >>>> on my old Celeron XP-Home system. And if I watch CPU usage while it
| >>>> runs,
| >>>> Task Manager sits pegged at 100% while it runs which is what I expect.
| >>>>
| >>>> I just ran it on an AMD X2 4200 though with XP-MediaCenter which runs
| >>>> it
| >>> in
| >>>> half the time. What surprises me though is that Task Manager tells me
| >>> that
| >>>> *both* CPUs run at about 50% each when the program runs. What I
| >>>> expected
| >>>> was to see one CPU pegged out at 100% and the other loafing along doing
| >>>> nothing.
| >>>>
| >>>> Is Excel 2003 written to take advantage of dual core? I didn't think
| >>>> it
| >>>> was. And if it is, why does it only drive the CPUs at 50% rather than
| >>> 100%?
| >>>>
| >>>> Thanks...
| >>>>
| >>>> Bill
| >>>>
| >>>
| >>>
| >>
| >
| >
|
 
B

Bill Martin

Touching the status bar is a 1% CPU load though, not a 50% load. And
disabling it makes no difference.

Anyhow, the real curiosity is that given the task somehow gets divided up
like that, it's not obvious to me why one or both CPUs don't peg out at 100%
usage like it does with a single CPU. Somehow XP or Excel or someone is
choosing to dog along rather putting full effort into the task.

Ah well... Thanks for the info on how yours handles it Niek.

Bill
----------------------------
 
S

steve yates

not sure if this observation is relevant, but i've got a spreadsheet running macros that typically ran at 50% cpu (ie 100% on one cpu, zip on cpu 2) all through development, then suddenly started hammering along on 80%+ evenly on both cpu's when I added a userform progress bar. Not yet benchmarked to see if it actually finishes quicker, or if the progress bar is actually slowing things down or speeding things up.

Running Excel 2003 on an XP machine,btw.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top