WPF performance problems caused by PNG Images

Source: Internet
Author: User

Due to project needs, our WPFProgramNeed to run on the terminal,

Running platform: Windows XP embedded

Hardware: Atom, 2 GB memory, gma950,

During the test, we found that the entire program was running very slowly. Because we used multiple threads, we initially suspected it was caused by thread switching. Using processexplorer to view the process, unexpectedly, we found that the CPU is mostly consumed on rendering. In addition, it is important to note that the CPU usage is kernel-mode.Code.

Without thinking about it, you can search on the Internet to optimize the performance of WPF.ArticleAnd installed several patches to upgrade the system to SP3.

In desperation, the background of our program uses a x PNG Image, whereas Silverlight does not support PNG. WPF support, whereas Silverlight does not. It's strange. What's special about this PNG image? But when we use PNG on xpe, is it just a "mine "?

Okay. So we changed the background image to JPG format. The performance will soon go up, and there is almost no kernel-state code to do.

What is the reason? What is the difference between PNG and jpg?

Communication with Microsoft engineers is said to be "there is no hardware accelerated implementation of PNG encoder as far as I know ", "probably the decoder takes a abnormal code path to decode the stuff into the system memory ".

Did the brothers in the garden study this?

PS:

In addition to the xpe system, some XP configurations also have the same problem. Vista and server2008 do not have this problem.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.