在Windows窗体隐藏标签需要244毫秒窗体、标签、Windows

2023-09-04 11:37:39 作者:彼岸花开、美到忧伤

我想看看我是否能找到问题的根源。我想使用.NET 4.0的超薄/紧凑的计算机上。当添加运行应用程序中的秒表需要的 244毫秒以运行 label.visible =假的只是一个简单的行; 在我的电脑上,只需要 22毫秒。的code。其他部分正在运行的100%的罚款,它只是这个领域。这可能是造成这?

I'm trying to see if I can find the source of a problem. I am trying to use .NET 4.0 on a slim/compact computer. When running the app with adding a StopWatch it takes 244 ms to run just a simple line of label.visible = false; where on my computer it only takes 22 ms. Other parts of the code are running 100% fine, it's just this area. What could be causing this?

下面是我想要运行的应用程序的系统。我知道它是一种廉价的电脑,但是这是在仅应用程序,将在其上运行。我已经经历了和卸载宏碁所有已安装的默认程序并运行所有的Windows更新。

Here is the system that I am trying to run the application on. I know its a cheap computer, but this is the only application that will be running on it. I have went through and uninstalled all default programs that were installed by Acer and ran all the Windows Updates.

Amazon.com - 宏碁Aspire雷沃AR3700-U3002超薄和紧凑的桌面

产品特点

1.8 GHz的英特尔凌动D525双核处理器 2 GB的安装DDR3内存 250 GB SATA硬盘(5400转) 在集成NVIDIA ION图形 Windows 7家庭premium

处理器,内存和主板

硬件平台:未知 处理器:1.8GHz的英特尔凌动 处理器数量:1 内存:2 GB 内存类型:未知 内存插槽:2

硬盘

尺寸:250 GB 类型:未知 转速:5400转

推荐答案

其实,它可以依靠什么平台,你正在开发上了。 GDI +加速辗转在Windows 7 / Vista操作系统。因此,让所有的GDI +的操作,即使是简单的,如表格隐藏/显示,要慢得多。

Actually, it could depend on what platform you're developing on too. GDI+ acceleration was removed in Windows 7/Vista. Thus, making all GDI+ operations, even simple ones such as hiding/showing of forms, much slower.

这是一件事,这不是在Windows Server 2008中删除,但由于在Windows Server 2008 R2中被删除。所以,如果你使用的是Windows XP或以下,或Windows Server 2008或以下的开发机器,它可以显着加快,比类似Windows 7或Windows Vista计算机。

This is one thing that was not removed in Windows Server 2008, but has since been removed in Windows Server 2008 R2. So if you're using Windows XP or below, or Windows Server 2008 or below for your development machine, it could be notably faster, than a similar Windows 7 or Windows Vista machine.

无论硬件加速,显卡的比较可能是为了过。内置的低端机显卡,很少比较列入开发机器的人。

Regardless of the hardware acceleration, a comparison of video cards could be in order too. Built-in video cards on low-end machines, rarely compare to the ones included in development machines.

其他性能问题是非常缺乏真正的RAM(尤其是如果它的运行64位),它可以推动GDI调用出令人难以置信的缓慢的硬盘驱动器(5400转),如果它没有足够的内存。

Other performance problems is the very real lack of RAM (especially if it's running 64-bit), it could be pushing the GDI calls out to the incredibly slow hard drive (5400 rpm) if it doesn't have enough RAM.

尝试实施WPF相同的测试?如果速度在WPF非常相似,这可能是由于视频/硬件加速的问题,或者是内存问题,从全3D硬件加速WPF的好处,并且主要使用视频内存的用户界面,而不是你的系统内存。

Try implementing the same test in WPF? If the speeds are very similar in WPF, it's probably due to a video/hardware acceleration problem, or a memory problem, as WPF benefits from full 3D hardware acceleration, and uses your video memory primarily for the UI instead of your system RAM.