Sahil Sharma
Sahil Sharma

Reputation: 4247

Performance or page load time check of web form page

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.

Upvotes: 1

Views: 727

Answers (2)

shivgre
shivgre

Reputation: 1173

Try performance measuring sites such as Gtmetrix

Just enter the sites URL and it will tell you load time and how to optimize site by minifying any css/js and other stuff.

This will only work if your website is live.

Other way is to inspect the net/network tab in your browser for each resource

Upvotes: 0

IrishChieftain
IrishChieftain

Reputation: 15253

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.

enter image description here

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.

Upvotes: 1

Related Questions