Whatever was your choice PHP, ASP.NET, Ruby On Rails or even JSP. You know that you can develop a website to give a specific result or to do some tasks in many ways. I mean you can change your code to make it shorter (or for any other reason) but to give the same result. In this case how do you test which code was faster to excute so you choose it to make your website faster? I mean do you have any tools or ideas in how to test the time of execution for your code and compare it with time of execution after you do some edit?
|
Talking about websites, you could install firefox (if don't have so already) and install the web-developer plugin. One of the tools measures rendering times of the html, download times and size of code/images. Time to execute Javascript. If your experience is alright (not just on the local machine, but in production environment) and you don't get complaints, I wouldn't do anything at all. |
|||
|
|
|
Every language I've used has had some sort of time functionality. If the ones you're using do as well then utilize that time feature to get a time stamp (if you do a unix time stamp it'll return an integer which is best) at the beginning of the program then a time stamp at the end. Subtract the first from the second and that's the number of units of time it took to run the program. The unix timestamp is in units of seconds. |
|||
|
|
|
For ASP.NET I use Visual Studio build in profiler, and only optimize code that needs to be optimized. Visual Studio has a nice feature that you can save profiling results and compare it. Another thing for ASP.NET is tracing, see this link |
||||
|
|
|
If that's an issue you have several ways to measure performance. The most simple way could be to just place a timer at the start and end of a piece of code ad let it run through a long loop to get an average result. Though this is not always very reliable. Another way would be to use a profiler if there exists one for your platform. In case of an web app I would use a Load tester like Apache JMeter |
|||
|
|
