How can I check the reason why An aspx page is slow?
I recently read an article about how to speed up An aspx page. This is a common interview question. The original question is from this website.
There are many causes for this problem. We need to troubleshoot the problem step by step to locate the problem.
1. Find out whether the interaction between the website itself and the database is slow. If the interaction with the database is executed during this page, extract these SQL commands and run them on the Database Console. If the execution of these statements on the Database Console is still slow, it indicates that the problem occurs in the interaction with the database. In this case, you need to consider optimizing these SQL statements.
A. Check whether an index is created to increase the query speed.
B. Using select * will reduce the efficiency.
C. Use the join keyword as few as possible.
2. If SQL statements are executed quickly, the problem may be caused by the website itself. In this case, we need to view each Page event one by one to determine which one is slow. There is a tracing tool in ASP. NET. We can use this tool to view how long each event took. Set Trace = "true" in page directive, and then you can see the time parameter list of each event at the bottom of the page.