I have a very large and complex library of macros which I developed largely
under Word 2000 and Windows 2000 on a computer with a 733MHz Pentium 3. I'm
now running them under Word 2002 and Windows XP on a laptop computer with a
2.2 GHz Pentium 4. I find that certain operations run much slower on the new
machine. "Much slower" means that a macro which used to display its first
dialog box in a second or less now typically takes 20 or 30 seconds to
display it.

Much of the slowness (but not all of it) seems to be associated with some
type of initialization. That is, the second time I run a macro it starts
much more quickly than the first time, although still not as quickly as it
did on the old machine.

The machines have the same amount of RAM (512MB). I can't identify any
differences that might account for this problem except that since the new
machine is portable, it has a slower disk, and its CPU might have a smaller
cache. I have a hard time believing that either of these factors accounts
for the drop in performance. I have watched the laptop computer's disk
activity light while these macros are starting, and it seems to be no more
busy than when the computer is idle.

What might be the problem here? How can I identify it?
.

Re: Macros running much slower than before by Word

Word
Thu Feb 19 01:13:28 CST 2004

G'day "Jonathan Sachs" <nobody@nospam.accepted>,

tables and lists changed dramatically, stick some timers in there and
see what bits take longer. Bookmarks and x-refs seem to get a recalc
triggered on first use, maybe thats it. Vague question, vague answer
;-)

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jonathan Sachs reckoned:

>I have a very large and complex library of macros which I developed largely
>under Word 2000 and Windows 2000 on a computer with a 733MHz Pentium 3. I'm
>now running them under Word 2002 and Windows XP on a laptop computer with a
>2.2 GHz Pentium 4. I find that certain operations run much slower on the new
>machine. "Much slower" means that a macro which used to display its first
>dialog box in a second or less now typically takes 20 or 30 seconds to
>display it.
>
>Much of the slowness (but not all of it) seems to be associated with some
>type of initialization. That is, the second time I run a macro it starts
>much more quickly than the first time, although still not as quickly as it
>did on the old machine.
>
>The machines have the same amount of RAM (512MB). I can't identify any
>differences that might account for this problem except that since the new
>machine is portable, it has a slower disk, and its CPU might have a smaller
>cache. I have a hard time believing that either of these factors accounts
>for the drop in performance. I have watched the laptop computer's disk
>activity light while these macros are starting, and it seems to be no more
>busy than when the computer is idle.
>
>What might be the problem here? How can I identify it?
>.
>


Re: Macros running much slower than before by Jonathan

Jonathan
Fri Feb 27 07:33:14 CST 2004

"Word Heretic" <myfullname@tpg.com.au> wrote in message
news:geo8301djgvrur4d604tf7pc615mmrtafs@4ax.com...
> G'day "Jonathan Sachs" <nobody@nospam.accepted>,
>
> tables and lists changed dramatically, stick some timers in there and
> see what bits take longer. Bookmarks and x-refs seem to get a recalc
> triggered on first use, maybe thats it. Vague question, vague answer
> ;-)

I'm sorry if the question seemed vague; I provided all the information I
have. I hoped that someone would recognize this as a problem already
encountered and understood.

I tried to track down the problem in the code with little luck. The more
resolution I attempted to obtain the less delay I saw. From this negative
evidence, I can only speculate that the whole thing has slowed down for some
reason.

There did seem to be a particular delay in a routine that manages bookmarks;
it deletes all of them and then redefines about 20 based on current
conditions. When I stepped through it, though, each individual bookmark
appeared to be processed instantaneously.

Having no way to run before-and-after tests, I can only guess when some
sequence of operations is taking longer than it should.



Re: Macros running much slower than before by Word

Word
Fri Feb 27 16:39:19 CST 2004

G'day "Jonathan Sachs" <nobody@nospam.accepted>,

Ahhh - have you seen the stopwatch code? You take the Timer at the
start and end and msgbox the results. You run your code and fiddle and
run again, or take multiple measurements along the way.

My Word VBA Beginner's Spellbook has many GENERAL optimisation tricks
that are probably applicable, as well as a full development checklist.
It is probably worth its tiny purchase price for you for just this
task :-)


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jonathan Sachs reckoned:

>"Word Heretic" <myfullname@tpg.com.au> wrote in message
>news:geo8301djgvrur4d604tf7pc615mmrtafs@4ax.com...
>> G'day "Jonathan Sachs" <nobody@nospam.accepted>,
>>
>> tables and lists changed dramatically, stick some timers in there and
>> see what bits take longer. Bookmarks and x-refs seem to get a recalc
>> triggered on first use, maybe thats it. Vague question, vague answer
>> ;-)
>
>I'm sorry if the question seemed vague; I provided all the information I
>have. I hoped that someone would recognize this as a problem already
>encountered and understood.
>
>I tried to track down the problem in the code with little luck. The more
>resolution I attempted to obtain the less delay I saw. From this negative
>evidence, I can only speculate that the whole thing has slowed down for some
>reason.
>
>There did seem to be a particular delay in a routine that manages bookmarks;
>it deletes all of them and then redefines about 20 based on current
>conditions. When I stepped through it, though, each individual bookmark
>appeared to be processed instantaneously.
>
>Having no way to run before-and-after tests, I can only guess when some
>sequence of operations is taking longer than it should.
>


Re: Macros running much slower than before by Jonathan

Jonathan
Mon Mar 01 06:57:04 CST 2004

"Word Heretic" <myfullname@tpg.com.au> wrote in message
news:5khv305qr8h06abf75n0i1nma7jtgaah7i@4ax.com...

> Ahhh - have you seen the stopwatch code?...

Thanks for the suggestion, but I'll pass. The cost of the book would be
trivial, but the cost of making use of it would be prohibitive.

The program will be retired in a few months, so I can't justify fixing a
problem that is not a show-stopper and would require a major debugging
project.