views:

383

answers:

7

I have an app that loads some XML docs into memory then runs various queries against it using Linq.

The app runs fine on the live server (Windows Server 2003) and under Visual Studio 2008 on XP. But on my Vista laptop (4gb RAM, 2GHz CPU) all the Linq queries run really really slow. What should take a couple of milliseconds instead takes a couple of seconds. The funny thing is is that all other parts of the code run smoothly and quickly as they should.

Has anyone else had trouble with this type of thing?

+1  A: 

No, I definitely have not. Take a peek at your System event log. Anything strange going on in there? Look at your CPU. Is something eating up your CPU? Is it what you think it is?

Dave Markle
A: 

I have not had any such issues with VS 2008 and SQL DEV on my desktop and laptop. My machine specs are similar to yours.

Picflight
A: 

No problems here, plenty of linq in my dev code base. Running Vista Ultimate (32) on my laptop for developement. Running windows 2003 on my test server.

No issues that I have noticed.

Harry
A: 

Get a profiler like the one built into VS, or the profiler from Red Gate (http://www.red-gate.com/) and find out what's actually happening!

Paul Betts
A: 

I've seen huge crazy-making performance problems under Vista that don't occur under XP - but only when I'm running a debug build under the IDE.

Robert Rossney
A: 

I have not seen the kind of performance issues you are reporting. See http://thinqlinq.com/Default/Querying-the-complete-plays-of-Shakespeare-using-LINQ-to-XML.aspx for a sample that queries the complete works of Shakespeare finding the characters with the most number of lines. When spanning 40 XML files each a hundred K in size resulting in a single 5 meg XML document, I'm still seeing sub-second querying time.

You may be running into issues with a complex join or recursive where clause that is causing your performance to degrade.

Why would the performance be fine on every other machine then?
cbp
A: 

How fast is the hard drive in your laptop. You may just be seeing the cost of loading a large xml file from disk.

Aaron Fischer
I believe that the files should be loaded into memory by the time I am running queries on them. The total size of the XML files are about 150kb and I have 4gb of memory so its not like I should be running out!
cbp