|I've hit a stumbling block on trying to figure out this problem. I have a winform app written in C# that was started back with 1.0 frame, then upgraded to 1.1, and recently I created a test 3.5 version. The deployed app is still the 1.1 as we have a lot of old 98 machines several of which don't want to upgrade to the 2.0 framework.
Here's the simplified code that I'm having problems with:
PrintDocument printDocument1=new PrintDocument();
foreach(PaperSource p in ps.PaperSources)
foreach(PaperSize p in ps.PaperSizes)
Basically my software has some 280 different reports and different ones go to different printers and to different sizes of paper. So the full code brings up an option screen that remembers the last settings and allows the user to store the settings for the specific report section and select a checkbox to not ask them for settings the next time they generate the report. The comments with numbers are to help identify how long it takes to do each section.
On my machine, a dual-core Server 2008 64 bit 4 gigs of ram, 8 printers set up, my 3.5 version in release mode takes this long:
On another Vista 32 bit machine, 2 gigs of ram, 12 printers set up, my 1.1 version in debug mode:
On my machine in a Hyper-V XP 32 bit window, 7 printers set up, using my 1.1 version in debug mode:
On my bosses new machine he received last week, a quad-core Vista 32 bit, 3 gigs of ram, 2 printers set up, my 3.5 version in release mode:
Using the 1.1 debug version puts 1->6 up to 17,255ms
Obviously, there's some sort of titanic problem with my bosses machine. The machine itself is incredibly fast. Every other operation in my software beats the tar timing-wise compared to my machine. As soon as it touches printers, it craps out. Wordpad/notepad/word/excel/acrobat/etc all seem to pull up printers fine. The machine is pretty "clean", all the crapware was uninstalled off of it, no virus scanner running, I've task manager killed everything non-critical. I've deleted all his printers out, reinstalled just the Microsoft XPS Document Writer. I've cleared out his temp folders and run a chkdsk. I've eliminated all the standard "this is why its slow" reasons that I know of. If it had been any other program on the machine, I would think its a windows issue, but since its just my software I'm stuck.
Does anyone have any suggestions on where to go from here?
It doesn't seem to be Vista 32 bit.
It doesn't seem to be number of printers.
It doesn't seem to be amount of ram.
It doesn't seem to be something running in the background.
It doesn't seem to be disk or printer corruption
It not affecting any "mainstream" apps
It doesn't seem to be a specific .NET framework version
So I don't know if its
Quad core and .NET
Some chunk of code I'm missing
Something I haven't thought of.