表现迟钝? [英] slow performance?

查看:79
本文介绍了表现迟钝?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我来这里是个新手。我有问题。我之前已经在VB6中编程了
,而且我制作的所有程序都快速运行了
。但是.NET程序运行得非常慢。我使用C#(因为没有特别的

原因)。


这不是算法(也就是程序*做*,有效)

罚款),但是UI的响应能力。该程序隐藏在托盘栏中

并坐在那里直到电话响起(这是来电显示程序)。


一切正常。数字被正确识别,数据库

被正确查找,但弹出窗口需要很长时间才能显示(有时20秒!)。当它正在加载时,硬盘工作了很多。


这台机器是Athlon 2200,配备512MB RAM和Windows XP Pro,所以我

不要以为这是硬件问题。 Windows任务管理器报告说它消耗了大约18MB的RAM。看起来太多了,因为它只有
使用了几种形式。该程序编译为RELEASE。 (不是调试)
VS 2003中的
。。exe是900k。


那么,有什么想法吗?

$ b $bHernánFreschi

Hi all, I''m a completely newbie here. I''m having a problem. I''ve
programmed before in VB6 and such, and all the programs I''ve made run
fast. But .NET programs run very slowly. I use C# (for no particular
reason).

It''s not the algorithms (that is, what the program * does *, that works
fine), but the UI responsiveness. This programs "hides" in the traybar
and sits there until the phone rings (It''s a Caller ID program).

Everything works OK. The number gets identified correctly, the database
is looked up correctly, but the pop up window takes a LONG while to
appear (20 seconds sometimes!). While it''s loading, the hard disk works
a lot.

The machine is an Athlon 2200 with 512MB ram and Windows XP Pro, so I
don''t think it''s a hardware problem. Windows task manager reports that
it''s consuming about 18MB of RAM. Seems like too much, because it only
uses a couple of forms. The program is compiled "RELEASE" (not "debug")
in VS 2003. The .exe is 900k.

So, any ideas?

Hernán Freschi

推荐答案

我只能看到制作表格(而且表格听起来很简单)需要

长时间弹出是数据库往返。注释掉数据库

查找并查看弹出窗体需要多长时间。你有一个查询通过的大型

数据集吗?您是否将过多的数据转回给客户?$ / b

Chris

"HernánFreschi" < HJ ******** @ hjf.com.ar>在消息中写道

news:cu ********** @ amigo.idg.com.pl ...
Only thing I could see making a form (and your form sounds simple) take a
long time to popup is the database round trip. Comment out the database
lookup and see how long your form takes to pop up. Do you have a large
dataset the query goes through? Are you transferring too much data back to
the client?

Chris
"Hernán Freschi" <hj********@hjf.com.ar> wrote in message
news:cu**********@amigo.idg.com.pl...
大家好,我是在这里完全是新手。我有问题。我之前已经在VB6中进行了编程等等,而且我制作的所有程序都快速运行。但是.NET程序运行得非常慢。我使用C#(没有特别的原因)。

这不是算法(也就是说,程序*做什么*,哪个好无效),但是UI响应。该程序隐藏在托盘栏中,
坐在那里,直到电话响起(这是来电显示程序)。

一切正常。数字被正确识别,数据库正确查找,但弹出窗口需要很长时间才能显示
(有时20秒!)。当它正在加载时,硬盘工作很多。

这台机器是Athlon 2200,配备512MB RAM和Windows XP Pro,所以我不认为它''硬件问题。 Windows任务管理器报告称它消耗了大约18MB的RAM。看起来太多了,因为它只使用了几种形式。该程序编译为RELEASE。
VS 2003中的(不是调试).exe是900k。

所以,任何想法?

HernánFreschi
Hi all, I''m a completely newbie here. I''m having a problem. I''ve
programmed before in VB6 and such, and all the programs I''ve made run
fast. But .NET programs run very slowly. I use C# (for no particular
reason).

It''s not the algorithms (that is, what the program * does *, that works
fine), but the UI responsiveness. This programs "hides" in the traybar and
sits there until the phone rings (It''s a Caller ID program).

Everything works OK. The number gets identified correctly, the database is
looked up correctly, but the pop up window takes a LONG while to appear
(20 seconds sometimes!). While it''s loading, the hard disk works a lot.

The machine is an Athlon 2200 with 512MB ram and Windows XP Pro, so I
don''t think it''s a hardware problem. Windows task manager reports that
it''s consuming about 18MB of RAM. Seems like too much, because it only
uses a couple of forms. The program is compiled "RELEASE" (not "debug") in
VS 2003. The .exe is 900k.

So, any ideas?

Hernán Freschi



Chris,All Things Insignificant写道:
Chris, Master of All Things Insignificant wrote:
只有我能看到制作表格(而且你的表格听起来很简单)才能获得长时间弹出是数据库往返。注释掉数据库
查找并查看弹出窗体需要多长时间。您是否拥有查询经过的大量数据集?您是否将过多的数据传回客户端?

Chris
Only thing I could see making a form (and your form sounds simple) take a
long time to popup is the database round trip. Comment out the database
lookup and see how long your form takes to pop up. Do you have a large
dataset the query goes through? Are you transferring too much data back to
the client?

Chris



否,实际上数据库查找在表单加载后开始。那是:


1.电话铃声

--->这里是延迟的地方

2。形式负荷。实际上表单已经加载但隐藏了,我用这个显示

它。这是一个方法。


3.鼠标光标到sandclock(按代码)

消息查找数据库...... (应该显示,但它不会,但是

我将在稍后处理)


4.数据库被查找

(此处没有延误)

5.数字终于显示

6.鼠标光标到箭头


数据库保存手动输入的数字,它少于30,并且

它被索引并且全部(它是一个访问2002文件)。

i * think *问题是程序对于内存来说太大了(18

megs)和windows交换它(这可以解释磁盘活动)。

所以是有办法减少内存占用吗?


hjf


no, actually the database lookup starts after the form loads. that is:

1. phone rings
--->here''s where the delay is
2. form loads. actually the form was already loaded but hidden, I show
it with this.Show();

3. mouse cursor to sandclock (by code)
message "Looking up database..." (SHOULD be shown but it doesn''t, but
i''ll deal with that later)

4. the database is looked up
(no delays here)
5. the number is finally displayed
6. mouse cursor to arrow

the database holds manually-entered numbers and it has less than 30, and
it''s indexed and all (it''s an access 2002 file).
i *think* the problem is that the program is too large for memory (18
megs) and windows swaps it (that would explain the disk activity).
so is there a way to reduce memory footprint?

hjf


系统上有多少内存?当你调用.Show时,是什么触发了数据库查找?
数据库查找?你打电话给Form.Show,然后是Form.LookupNumber吗?它你

去掉实际查找的代码,表格是否快速响应

电话响了?


消息查找数据库......问题,只需要一个textbox.update或一个

application.doevents刷新显示。


Chris


HernánFreschi < HJ ******** @ hjf.com.ar>在消息中写道

新闻:cu ********* @ amigo.idg.com.pl ...
How much memory is on the systems? When you call .Show, what triggers doing
the database lookup? Do you call Form.Show, then Form.LookupNumber? It you
rem out the code that does the actual lookup, does the form respond quickly
after the phone ring?

The message "Looking up database..." issue, just do a textbox.update or a
application.doevents to refresh the display.

Chris

"Hernán Freschi" <hj********@hjf.com.ar> wrote in message
news:cu*********@amigo.idg.com.pl...
克里斯,万事万物无意义写道:
Chris, Master of All Things Insignificant wrote:
只有我能看到制作一个表格(而且你的表格听起来很简单)需要长时间弹出是数据库往返。注释掉数据库
查找并查看弹出窗体需要多长时间。您是否拥有查询经过的大量数据集?您是否将过多的数据传回客户端?

Chris
Only thing I could see making a form (and your form sounds simple) take a
long time to popup is the database round trip. Comment out the database
lookup and see how long your form takes to pop up. Do you have a large
dataset the query goes through? Are you transferring too much data back
to the client?

Chris


不,实际上数据库查找在表单加载后开始。那就是:

1.电话铃声
--->这里是延迟的地方
2.表格加载。实际上表单已经加载但隐藏了,我用它显示它。显示();

3.鼠标光标到sandclock(按代码)
消息向上看数据库..." (应该显示,但它不会,但我会稍后处理)

4.数据库被查找
(此处没有延迟)< 5.数字终于显示了
6.鼠标光标到箭头

数据库保存手动输入的数字,它少于30,而且它是''索引和所有(它是一个访问2002文件)。
我认为*问题是该程序对于内存来说太大(18
megs)和windows交换它(这可以解释磁盘活动)。
有没有办法减少内存占用?

hjf


no, actually the database lookup starts after the form loads. that is:

1. phone rings
--->here''s where the delay is
2. form loads. actually the form was already loaded but hidden, I show it
with this.Show();

3. mouse cursor to sandclock (by code)
message "Looking up database..." (SHOULD be shown but it doesn''t, but i''ll
deal with that later)

4. the database is looked up
(no delays here)
5. the number is finally displayed
6. mouse cursor to arrow

the database holds manually-entered numbers and it has less than 30, and
it''s indexed and all (it''s an access 2002 file).
i *think* the problem is that the program is too large for memory (18
megs) and windows swaps it (that would explain the disk activity).
so is there a way to reduce memory footprint?

hjf



这篇关于表现迟钝?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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