C # performance optimization practices (1)

Source: Internet
Author: User

C # performance optimization practices

Performance is an important indicator to consider the quality of a software product. It plays an equally important role in product functions. When you select a software product, you will test and compare the performance of similar products. It is one of the important factors for purchasing the software.

Performance of Software refers to performance optimization principles and how to discover performance bottlenecks

As mentioned in the previous section, the first step of performance optimization is to discover performance bottlenecks. This section describes some practices for locating performance bottlenecks.

Performance Optimization Methods and Techniques

There are many solutions after locating performance problems. This section describes some performance optimization techniques and practices.

  • Cache
    Cache is the most commonly used Optimization Method in performance optimization. It is applicable to frequent data acquisition, and it takes a long time to obtain the data each time. At this time, the method will be used during the first acquisition, and the data will be cached after the acquisition. Then use the cached data. If the cache optimization method is used, pay special attention to the synchronization of cached data. That is to say, if the actual data changes, the cached data should be cleared in a timely manner, make sure that no error data is used because of the cache. Example:
  • Improves response time asynchronously.
  • Understanding platform features
    For example, the DP of WPF is very slow compared with the CLR property, including Get and Set, which is different from the general quality of Get. If a DP needs to be read multiple times, it is recommended that the CLR property be used for Cache.
  • Progress bar to improve user experience
    Sometimes, none of the above solutions can quickly respond to user operations, progress bars, images that have been circled, and prompt text such as "Your operations may take a long time to wait ". Can improve user experience. It can be considered as the final solution.
  • Related Article

    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.