2440升级系统到wince6.0速度变慢
我使用的是s3c2440的处理器,以前使用wince5.0,现在升级系统到wince6.0,应用程序没有改动,但是在wince6下运行速度变慢,特别是弹出对话框和关闭对话框的时候。求指点
[解决办法]
建议LZ先试试WinCE本身是不是慢?
[解决办法]
这个问题以前遇到过,是与CPU有关的,从国外的网站看到过。原址已失效,摘抄如下:
Question:Hi guys,
I have a project using CE6.0, HW platform is samsung S3C2440, 64MB SDR.
The problem is: When I call CreateDibSection in my app, it always set PAGE_NOCACHE to the memory it allocated.
That I believe caused my bitblt and other access to the memory really slow, about 3~4 times slower than a memory alloctaed by new.
I tried CE5.0 on the same HW, CreateDibSection works fine on that, no PAGE_NOCACHE flag set to the memory it allocated, and the app runs fast.
But it's jus a test, I can't really use CE5 for the project. So please help~~, what is the possible cause to the PAGE_NOCACHE problem??
Answer:It is possible due to your CPU is virtual tag cache; in CE6, kernel adds
PAGE_NOCACHE attribute when VirtualAllocCopy an existing memory (2 VA map to
on PA) to avoid cache coherency issue.
In case you are interested, trace the code in PROCVMAllocCopy
(private/winceos/COREOS/nk/kernel/process.c) and then to VMAlias in
(private/winceos/COREOS/nk/kernel/vm.c)
It seems you don't have much choice, either upgrade the hardware to ARMV6
based system or back to CE5.
这段话大概的意思是ARMV5架构的CPU(是用的virtual tag cache,CE6的内核在进行内存分配的时候根据这个情况会将内存打上PAGE_NOCACHE标志,而CE5则没有做这个处理。所以CE6下贴图要比CE5下慢,在CE6的PROCVMAllocCopy 和VMAlias函数中都有一个进行判断的函数IsVirtualTaggedCache,其代码如下
01.#ifdef ARM
02.#define ARMArchitectureV6 0x7
03.#define ARCHID_OFFSET 0x02a0
04.#define IsVirtualTaggedCache() (__GetUserKData (ARCHID_OFFSET) < ARMArchitectureV6)
05.#endif