poor performance of Word2007/Vista; not for other OS/Word versions

  • Thread starter philips-atp01171
  • Start date
P

philips-atp01171

Hello,

We have problems with the performance of Word 2007 in combination with
Windows Vista. We have got a Word document that contains a lot of bookmarks.
All of the bookmarks have to be enumerated to check their start- and
endpostion. This worked fine for Xp/Word2003, Xp/Word2007 and Vista/Word2003.
If the code is run on Vista/Word2007 we are facing severe performance
problems. To demonstrate the problem we wrote a VBA macro that iterates the
bookmarks just to see (and compare) the durations. The outcome is listed
below. There is also inactive code (commented out) showing how we created the
bookmarks needed for testing.

Vista/Word2003, 10 iterations, duration: 16ms
Vista/Word2003, 100 iterations, duration: 1.576ms
Vista/Word2003, 1.000 iterations, duration: 15.787ms

Vista/Word2007, 10 iterations, duration: 30.903ms!
Vista/Word2007, 100 iterations, duration: 308.476ms!
Vista/Word2007, 1.000 iterations, duration: 3.088.024ms!

Xp/Word2003, 10 iterations, duration: 141ms
Xp/Word2003, 100 iterations, duration: 1.531ms
Xp/Word2003, 1.000 iterations, duration: 15.265ms

Xp/Word2007, 10 iterations, duration: 161ms
Xp/Word2007, 100 iterations, duration: 1.613ms
Xp/Word2007, 1.000 iterations, duration: 16.237ms

As you can see the results for Vista/Word2007 combination is drastically
slower than the others. The tests were run on a DualCore 1.86 GHz computer
with 1 GB RAM (XP) and 4 GB RAM (Vista).

OS Details
XP: Professional, English, SP2
Vista: Enterprise, English, SP1

Office details
Word2003: English, SP2 (build: 11.8134.8132)
Word2007: English, SP1 (12.0.6311.5000 SP1 MSO 12.0.6213.1000)

Active AddIn is just “Person Name†and there are also some inactive AddIns
(they are also just standard Word AddIns, therefore the dlls are not listed
here):
• Custom XML Data
• Financial Symbols
• Headers, Footers and Watermarks
• Hidden Text
• Measurement Converter
• Time

The macro code used to perform the tests:

Private Declare Function GetTickCount Lib "kernel32" () As Long

Sub StressTest()
Dim i As Integer, ix As Integer, j As Integer, it As Integer, k As Integer
Dim t1 As Long
Dim bmk As Bookmark

‘ create document
' For i = 1 To 1000
' Word.ActiveDocument.Range.InsertAfter "bmk" & i & " "
' Next
'
' ix = 0
' For i = 1 To 1000
' Word.ActiveDocument.Bookmarks.Add "bmk" & i
' Set bmk = Word.ActiveDocument.Bookmarks.Item("bmk" & i)
' bmk.Start = ix
' bmk.End = ix + Len("bmk" & i)
' ix = ix + Len("bmk" & i) + 1
' Next
'

it = 1
For j = 1 To 3
it = it * 10
t1 = GetTickCount
For k = 1 To it
For i = 1 To 1000
Set bmk = Word.ActiveDocument.Bookmarks.Item("bmk" & i)
ix = bmk.Start
ix = bmk.End
Next
Next
MsgBox k - 1 & " iterations: " & GetTickCount - t1 & "ms"
Next
End Sub

Would there be any advise how to speed the performance for Vista/Word2007?
Or is this is a known problem of the Vista/Word2007 combination?

Thanks in advance,
Johannes
 

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