I have made few performances changes to my web form page- example bringing data from memcache instead of database and removing unnecessary db calls.
I want to measure the page load improvement- pageload time before and after the changes.
I looked at this post: Calculating Page Load Time In JavaScript - using
var loadTime = window.performance.timing.domContentLoadedEventEnd- window.performance.timing.navigationStart;
This didn't help much. It gives me absurd result with few loadTime as high as 10000 and other as low as 300. Also, I do not see much difference when i have removed database call from the code.
What should i do? How can i accurately calculate the performance or page load time of a web page on my local machine.
You could enable Trace in your page directive and go that route. But really, this information is at your fingertips with the browser developer tools of any of the main browsers such as Firefox, Chrome or IE. Simply hit F12 and select the 'Network/Net" tab. Experiment by placing the cursor over the time lines, etc.
As regards testing performance on your local machine, it's going to be different in production where different users are at the mercy of the devices they are using and the type of connection they have. Don't make decisions on performance based solely on what takes place on your local host. If this is a critical application, then subject it to some real load testing.