WEB program code optimization and improved website access speed

Source: Internet
Author: User
Tags coding standards readable

Here is a summary of the optimization of web programs. Although I use PHP, I don't actually manage the same language direction.
1. Improved readability of standardized codes
I don't think the general programmers will understand the coding standards. If you are blank in this aspect, you should make up the basics. Coding standards are the most basic requirements of a good programmer, A team should also have its own coding specifications. Therefore, program optimization should also include this aspect. Some omissions may occur during your program development. Therefore, it is necessary for us to optimize code standardization and readability. In fact, you may not be able to understand a good program code several years later, not to mention the code that others can view, so that the code you write can be more readable, this is what a good programmer should do and is responsible for a team and your own work.
The optimization direction is to make your code clearer and easier to understand.
2. Program efficiency and process logic optimization
Optimization of program efficiency is the most important. Program running speed is the most important factor in program code quality. Program logic is actually your solution. The solution is not the only one, so we can optimize it. The logic design also has a certain relationship with readability, and the logic is clearer and more readable.
The direction of optimization is clear about speed improvement and logic. Simple logic does not necessarily mean that it is fast, and complicated logic is not necessarily slow. Therefore, these two aspects are related.
3. SQL optimization to reduce the number of queries
In database programs, we know that database queries account for a large proportion of the execution of the entire program, so SQL optimization is very important.
The optimization direction is on the one hand the optimization of SQL statements. Those familiar with SQL should know that the efficiency of different SQL statements varies greatly, such: do not add functions to fields as much as possible. More users can search for efficient SQL statements. The second is to reduce the number of queries on a page. It is clear that we can output SQL statements on the entire page for analysis, whether statements can be merged, and whether redundant fields can be used, minimize the number of SQL queries and never use them in a loop.
4. Cache optimization
Cache optimization is actually a supplement to the previous one, but cache optimization is very important, so it can be separately listed as one. The cached data is mainly read from the database. Some introduction to caching: http://www.coderhome.net/zifa? P = 195. Of course, the cache should also be appropriate. You should only cache the data to be cached.
5. Optimize html, css, and js files to reduce redundant code
This is irrelevant to the server program and mainly involves browser-related aspects. The structure of html will affect the resolution of the browser, so good html code will also affect the access speed. In contrast, the client code does not allow the existence of useless things, so you can reduce the number of files by one K. Although JavaScript is executed on the client, its efficiency should also be considered. This article is also available on the Internet.
6. Availability optimization
Availability optimization mainly refers to UED. Not every team has a dedicated UED. As a web application developer, you should also be aware of this and understand users, instead of writing code. We strive to make the pages you develop more user-friendly and easy to use.
7. Framework Architecture optimization
If a development framework is used, the framework optimization should also be taken into account to reduce the resources occupied by the framework.
Others: server architecture optimization and database optimization
These aspects are not directly related to program development, but they are also closely related to the running of web programs.

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.