Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

I have a project with WPF and i use in this project linq to entities and devexpress but the problem is that my project is too slow because my database is big and have many data.
If someone have solution to make my project more easier than before , please help me
Posted
Updated 2-Jan-12 10:45am
v2

I'm sorry to tell you, but we can't help.

The problem is that there are so many things that could be slowing down your software, that to give you any concrete results, we would have to give you such a massive list of generalities that you would have to wade through it for hours looking for anything that might be relevant.

So, instead, here is what I do when I need to speed up software:
1) Quantify the problem. Add code to measure the actual speed, and record details for what parts of the software are performing quickly and slowly. This gives you numbers to check your "improvements" against.
2) Target slow features that are commonly used. Ignore those that aren't done often - they can be worruied about later if they are a problem.
3) Add timing until you get a sense of where code is slow: it might be in your DB access, or it could be that you are transferrign large amounts of data that you don't use.

When you can tell what is slow, you can start to look at (or ask about) improving that code.
For timing, look at the Stopwatch class.[^]
 
Share this answer
 
Comments
Wonde Tadesse 2-Jan-12 16:49pm    
5+
Wendelius 2-Jan-12 17:03pm    
Agree, 5'ed
RaviRanjanKr 2-Jan-12 17:08pm    
My 5+
Happy New Year Griff :)
As you have DevExpress, why not use Xpo[^]?

You should also take a look at DXGrid: Server Mode[^]

The DXGrid supports a binding mode designed to work with large datasets. This is called server mode. With this mode, even if the grid control is connected to a data store containing millions of records, the initial data will be displayed immediately, and subsequent data will be loaded rapidly on scrolling.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Wonde Tadesse 2-Jan-12 16:49pm    
5+
Espen Harlinn 2-Jan-12 16:50pm    
Thank you, Wonde Tadesse!
Wendelius 2-Jan-12 17:02pm    
Good answer, 5.
Espen Harlinn 2-Jan-12 17:03pm    
Thank you, Mika!
RaviRanjanKr 2-Jan-12 17:07pm    
Nice link, bookmarked !
Happy New Year
The question is so large that without further knowledge about your bottleneck, it's impossible to answer how to speed up the application. Few basic things to check though:

- Database indexing. Are your queries taking a long time. Look at for example this: Database performance optimization part 1 (Indexing strategies)[^]

- If using grid and you have lots of columns make sure that you use AllowHorizontalScrollingVirtualization

- could you fetch less data, just the things that are needed for the operation.
 
Share this answer
 
Comments
Wonde Tadesse 2-Jan-12 16:49pm    
5+
Wendelius 2-Jan-12 17:01pm    
Thanks :)
Espen Harlinn 2-Jan-12 16:55pm    
My 5 - good advice and a nice link - It's worth noting that the DevExpress components have special features that eases the development of applications that needs to deal with large result sets.
Wendelius 2-Jan-12 17:02pm    
Thanks :) Yep, just read your answer, XPO is one possibility. Personally I don't like using it because of some limitations and controllability, but depending on the project it might be just fine :)
Espen Harlinn 2-Jan-12 17:08pm    
It has evolved considerably over the last year - and now provides a fair number of new features that you can use to address those issues.
There are tools for profiling an application. Many of them have trials. You can also download Visual Studio 2011 preview or 2010 premium/ultimate trials to evaluate if the extra tools would benefit for you. Other tools for performance profiling are much less expansive. Try them and buy the one that fit your need.

For Linq to entities, you can use http://www.linqpad.net/[^] to time some complex quries and try to write them in alternative ways.

It is particular useful to check the number of request that are made. Whenever the number of request increase with returned data size (sub queries), it should be optimized to get the data in fewer queries.

On the other hand, in some case, it might be a lot easier to do 2 independant queries if most results are used anyway.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900