views:

758

answers:

9

Hi there,

I've developed an Excel 2003 addin in C#, using VSTO and VS 2008. The addin works just fine on my machine (HP NC6320 laptop, 3gb RAM T5600 1.8ghz Core2 cpu), however when it is tested on another users machine (HP nc6710b laptop 2gb RAM, T7200 2ghz Core2 cpu), it is substantially slower. I've also tried it on another laptop the same type as mine, and it is also fast

I've been through the obvious things, like applications running, Antivirus stuff, etc. The machines are both fully patched, and up to date.

Basically, what the addin does is: 1. Read data from a SQL Server 2005 database 2. Do some manipulation on it 3. Display it on a worksheet, and format it appropriately

The slow bit is the displaying on the worksheet.

I'm stumped as to why it would be slower on a newer machine.. Just to really confuse myself, I tried it on a VM (VMware Workstation v6.5) with 256mb RAM, and 1 cpu, running xp and only Office 2003 installed on it, and it was substantially quicker than the new laptop.

So in summary, an Excel Addin performs quickly on a low spec VM, and on an older laptop, but on a newer spec laptop it is slower.

Any suggestions would be gratefully recieved ?

Many thanks

Nick

edit:

Ok, I've checked the printer drivers, they are the same... I've checked the fragmentation levels, and if anything, the faster machine is less fragmented than the slower one..

Am looking at the events settings..

A: 

I've encountered newer higher spec laptops that have horrible hard drive performance. You might also have fragmentation.

AaronLS
Interesting suggestion, however, the machines have identical hard disks, fragmentation (while there) isn't excessive.
Nick Haslam
+2  A: 

Check that the slow machine does not have any XLA or COM addins installed (ie Google Office Addin) or any other potentially event-trapping code in Personal.XLS etc

Presumably you are already doing all the standard speedup things such as: - turning off automatic calculation and screenupdating before writing to XL - writing and formatting cells in a single large block rather than cell-by-cell - ...

Charles Williams
+2  A: 

You can also add

Application.EnableEvents = False

to your code before starting dumping your data to spreadsheet to stop any other Excel Add-Ins or any VBA code waiting for applciation level change/update events. Don't forget to re-enable events after your are done!!

Adarsha
A: 

Check the printer driver that you have configured on both machines. In fact, to rule this out, switch to one of the "file based" drivers (Microsoft XPS for example). I've had some issues with Word taking ages to do stuff that's been based upon the printer driver and Word's need to check what the printer is capable of in some situations.

Martin Peck
A: 

Update office to latest version (see Microsoft website / Microsoft Update).

Check the version of installed VSTO/PIA...

Check installed office/excel plugin.

Use a profiler to see which call is slow.

François
A: 

One thing I notice between the faster computer and the slower computer is the 1GB of RAM. Have you checked memory usage on the machines while the app is running? I know 1GB of RAM has made some serious progress (at least in my perception) of the speed of a computers ability to do something.

scottm
A: 

If the machines are running Vista, you can go into System Information (quickest way to get there is Windows key + Pause; don't know offhand how to get there the slow way via Control Panel). It'll show a set of five performance numbers: memory performance, hard drive performance, graphics performance, etc. Compare those numbers on the two machines; it could be that the "newer" machine has slower RAM, or a slower hard drive.

Joe White
A: 

Check how many files are in %temp% on each machine.

Scott Hanselman
A: 

Are some of the machines running 32 bit OS and others running 64 bit OS? Mixing 32 and 64 bit code will add overhead?

JonnyBoats