Importance of code review

Source: Internet
Author: User

In the past few days, a customer has been engaged in product upgrade, and most of the data has been transferred, because the main goal of the upgrade is to solve performance problems, therefore, I performed some operation performance checks on the version to be upgraded. I really don't know what it is. When I got a fright, I found the page data of the selected personnel (60,000) the result shows that it took 50 s ...... oh, my God

Open it carefully if there is no wayCodeThe analysis result is as follows:

1. The data binding operation is performed twice. The most terrible thing is that all 60,000 data records are directly bound at one time, which directly reduces the efficiency by about 40 s (note: our system uses partial binding for data query, only binding the data to be displayed). After modification, the query takes about 10 seconds.
2. After the data is queried in the code, a circular traversal is performed on the data. The three columns are merged into one column, which takes about 3 seconds ...... faint again... the modification method does not need to be discussed. The operation is directly put into the SQL statement, and the running time of the SQL statement remains unchanged.
3. After the SQL statement is analyzed, the where clause returns two directly equal fields (where psnaccount. personid = psnaccount. personid), and no necessary database operations are performed. after removal, the SQL statement execution is improved by 3 S. After code analysis, this condition is generated because the usage of a public component is incorrect ...... speechless

The lessons learned from this fact allow me to clearly understand the importance of code review, especially in the process of software product development, a very simple principle: the sooner code review is done, the better the product can be done!

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.