Boosting CPU share

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Boosting CPU share

Post by ChrisGreaves »

Below is a screen snapshot of Task Manager; I am waiting (im)patiently while my Indxr program slogs through a huge document.
TaskMgr.png
I note that WinWord.exe is using only 50% of the CPU; nothing else (of mine) is running.

Assuming that it is only CPU that is holding back progress (i.e. not hard drive access, internet connection etc); that is, that the Indxr process is CPU-bound, how can I (next time!) tell Win7 to offer, say, 90% of the CPU to Indxr?

My O/S knowledge is somewhat archaic; I worked on page-swapping mechanisms back in '68, so I am tolerant of arguments in this sphere.

I wonder, mainly, if there is a simple knob that can be rotated to dedicate more resources to a specific instance of execution of a specific application.
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Boosting CPU share

Post by HansV »

If you have a not-too-old computer, you probably have a multi-core CPU. This means that your CPU actually exists of several CPUs working side by side. You can check this by looking at the Performance tab of Task Manager.
I think VBA hasn't been programmed to make use of multiple cores simultaneously, so it utilizes only one of them.

(Recent versions of Excel can use multiple cores for calculations)
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Boosting CPU share

Post by ChrisGreaves »

HansV wrote:If you have a not-too-old computer, you probably have a multi-core CPU. This means that your CPU actually exists of several CPUs working side by side. You can check this by looking at the Performance tab of Task Manager. I think VBA hasn't been programmed to make use of multiple cores simultaneously, so it utilizes only one of them. (Recent versions of Excel can use multiple cores for calculations)
Hans, thanks for the prompt reply; I have killed the job and will probably let it run overnight; 7,300 pages takes about two hours, plus part of the doc is in Punjabi, a first time for me.
TaskMgr2.png
The computer is a DELL Inspiron, perhaps two years old.
I suspect (in CPU Usage history) the two boxes for CPU indicate that I have two CPUs, and that my earlier snapshot showing 50% CPUsage is effectively 100% usage of half of the CPUs.

I will NOT :StampFoot: rewrite Indxr in Excel (although it is tempting; it is, after all, just text processing, which I can do in Excel. :grin:
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Boosting CPU share

Post by ChrisGreaves »

HansV wrote:(Recent versions of Excel can use multiple cores for calculations)
P.S. It seems that not everything is hunky-dory even in Excel VBA:-
Google Search
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Boosting CPU share

Post by HansV »

I meant worksheet calculations in Excel, not VBA in Excel.

Although Microsoft has updated VBA to profit of 64-bit processors, most of it is still the same as in the early '90s...

And yes, you have a two-core CPU. The 50% for Word meant probably that one core was utilized at 100%, as you mention.
Best wishes,
Hans

User avatar
DaveA
GoldLounger
Posts: 2599
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Boosting CPU share

Post by DaveA »

You have 16 entries list as 00, but that means that it is using LESS THAN 01.
So if you add up all of those 00 that just may add up to about 15%, which still is NOT all of the usage.
Plus at the time the report was done, the taskmgr was at the end of the usage, so what was it's usage during this time?
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
John Gray
PlatinumLounger
Posts: 5406
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Boosting CPU share

Post by John Gray »

ChrisGreaves wrote:I suspect (in CPU Usage history) the two boxes for CPU indicate that I have two CPUs, and that my earlier snapshot showing 50% CPUsage is effectively 100% usage of half of the CPUs.
This would be better worded:

Although I have only a single physical CPU, the two boxes for CPU indicate that it has two cores, and that my earlier snapshot showing 50% CPU usage is effectively 100% usage of one of the two cores in the CPU.

Hence the usage of "Intel Core Duo" and "Intel Core 2 Duo" in oldish computers. You could get Core 2 Quads (I am typing on a computer with one), you should look up what is said about the newer i3, i5 and i7 CPUs. It seems to me that with the programming you have done you could certainly do with a newer CPU than that which came with an old Inspiron! Why not buy a second-hand newish Optiplex with some significant CPU grunt?
John Gray

"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Boosting CPU share

Post by ChrisGreaves »

HansV wrote:Although Microsoft has updated VBA to profit of 64-bit processors, most of it is still the same as in the early '90s...
(sigh!)
So even when I am almost caught up with the latest super-technology - dual core, touch screen etc etc - I'm still held back by the crimson software.
Why do I have a sense of 1968 deja-vu? :sad:
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Boosting CPU share

Post by ChrisGreaves »

DaveA wrote:You have 16 entries list as 00, but that means that it is using LESS THAN 01.
That makes sense to me.
So if you add up all of those 00 that just may add up to about 15%, which still is NOT all of the usage.
Not all the usage of the second CPU; we gather that the first CPU is thrashing its little heart out (serves it right, too!)
Plus at the time the report was done, the taskmgr was at the end of the usage, so what was it's usage during this time?
I have no idea.
All I know is that it would have been nice if the 7,000 page index had run faster (see below)
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Boosting CPU share

Post by ChrisGreaves »

John Gray wrote:It seems to me that with the programming you have done you could certainly do with a newer CPU than that which came with an old Inspiron! Why not buy a second-hand newish Optiplex with some significant CPU grunt?
Good question, John; let's see what sort of answer I can up with come.

I rarely (nowadays) tackle large text jobs; gone are the days of converting 100,000 documents in batch mode.
This job is a 7,000 page multilingual (Punjabi & English) text.
I've never indexed a 7,000 page document before.
Plucky little Indxr runs at about one second per page, for sure over 20- and 400-page documents, even in Norwegian.

I suspect that I have an exponential cost creeping in at 7,000 pages, not visible in the 20 and 400-page range. It ran for four hours (should have been about two hours) before I killed it.

In the end I had to
(1) Split the document into ten smaller pieces so that my parser could digest it - about 45 minutes per chunk
(2) Combine the 10 Concordance tables and eliminate duplicate entries
(3) Combine the 10 chunks back into a single document so I could pass the concordance table to Insert, reference, index, AUTOMARK) which bombed out about half-way through with an "Edit-Undo" overflow
(4) Split the document into 3 parts to Automark each part
(5) Combine the 3 chunks back into a single document so I could Insert the {IX} field and make use of all the {XE} fields.

If I thought I was going to get one of these tasks each week, I'd probably charge for it and buy a real computer, but for now I'm relieved that (a) I discovered what happens at the high-end of document sizes - I have to segment - and (b) I got the Index made before I leave on holiday!
There's nothing heavier than an empty water bottle

User avatar
BobH
UraniumLounger
Posts: 9266
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Re: Boosting CPU share

Post by BobH »

You've probably covered this already, Chris, but in case you have not . . .
CPUs.jpg

This screenshot is one I just made of the Resource Manager information (accessible from the Task Manager). From the CPU tab, clicking Monitor in the menu bar gives the option to Select Processors. My Intel Core i5 has 5 as shown; however the graphs in the Resource manager show only 4. I have no idea why that is the case. Perhaps the Help function explains it further.

I have noticed that the Total CPU usage sometimes has a blue line which I have assumed means usage in a second CPU. Still have to research the significance of the blue line.
You do not have the required permissions to view the files attached to this post.
Bob's yer Uncle
(1/2)(1+√5)
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Boosting CPU share

Post by HansV »

Your Intel Core i5 has 4 processor cores named CPU0, CPU1, CPU2 and CPU3. The top entry in the Select Processors dialog is <All CPUs>, not a separate CPU. You can tick or clear the 4 check boxes below in one go by ticking or clearing the <All CPUs> check box.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Boosting CPU share

Post by ChrisGreaves »

I finally saw my laptop hard at work!
DualCPUs.png
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle