如何提高我的WPF项目速度 [英] how to make my wpf project speed

查看:94
本文介绍了如何提高我的WPF项目速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个使用WPF的项目,并且在该项目中使用linq来访问实体和devexpress,但是问题是我的项目太慢了,因为我的数据库很大并且有很多数据.
如果有人有解决方案使我的项目比以前更轻松,请帮助我

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

推荐答案

很抱歉告诉您,但我们无济于事.

问题是,有太多的事情可能会减慢您的软件速度,从而给您任何具体的结果,我们必须给您提供如此庞大的一般性列表,您必须花大量时间浏览它才能找到任何东西可能相关.

因此,相反,这是我需要加快软件速度时要做的事情:
1)量化问题.添加代码以测量实际速度,并记录有关软件哪些部分正在快速和缓慢地执行的详细信息.这样可以给您提供一些数字,以检查您的改进"情况.
2)定位常用的慢速功能.忽略那些不常做的事情-如果有问题,以后可以担心.
3)添加计时,直到您感觉到代码缓慢的地方:它可能在您的数据库访问中,或者可能是您正在传输大量不使用的数据.

当您知道什么比较慢时,就可以开始研究(或询问)如何改进该代码.
有关计时,请查看 Stopwatch类. [
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.[^]


使用DevExpress时,为什么不使用 Xpo [ DXGrid:服务器模式 [
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


问题如此之大,以至于没有对瓶颈的进一步了解,就无法回答如何加快应用程序的速度.几乎没有什么要检查的东西:

-数据库索引.您的查询需要很长时间吗?例如,查看以下内容:
数据库性能优化第1部分(索引策略) [
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.


这篇关于如何提高我的WPF项目速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆