views:

62

answers:

6

Hello,

I was searching the web for this but found no satisfying answer.

I am not talking about the time it takes the browser to render and display. Only the part where the HTML is generated in the server itself.

<?php
$script_start = microtime_float();
#CODE
echo (microtime_float()-$script_start)
?>

What is the accepted/normal time in web pages. Lets say the page has a calendar, poll, content, menus(with submenus), some other modules.

Is it okay if it is less than 0.05seconds?

What do you think, what is the highest normal/accepted time it should take?

+2  A: 

I've got this bit of string, how long should it be?

Your page will take as long as it needs to, based on what you're trying to do, how you're trying to do it, what platform you're running on, whether you're marshalling data from third-parties and a thousand and one other unknowable variables.

There will be an upper limit on what your users find acceptable, and if you find yourself frequently breaching that bound, then you could try some workarounds, e.g. caching data, lowsrc, asynchronous elements, etc.

But as it stands, there's no specific answer to this general question.

Unsliced
As standards of course not. But how long are you willig to wait before starting to refresh, give up or go crazy. What would you expect for a smooth ride.
mardicas
A: 

There's no correct answer to this, satisfying or otherwise. You should obviously be aiming to render the html in as little time as possible, but you can't put an arbitrary figure on how long that should be.

Having said that, if your pages are rendering in less than 0.05 seconds I don't think you've got anything to worry about!

Nick
A: 

You should read this story about Google's measurements on this very topic.

clee
Thank you, just what i was looking for...keeping the whole shebang under 0.5-0.4 seconds should be acceptable for the user. So generation time of 0.05 or less should be way in the clear :-)
mardicas
A: 

I think there is no such thing like as a highest accepted time. As @Johannes points out it depends on how many users you have. Execution speed matters for Facebook - they even wrote a Compiler for it :) There are some nice benchmarks on http://www.phpbench.com/ and some optimizing tips on http://phplens.com/lens/php-book/optimizing-debugging-php.php

mre
A: 

That's one of the so-called "non-functional requirements". Too often they're forgotten. Others are "how often should my page crash", and "what's the desired uptime", and "should the page look different when printed?"...

You should take a look at how your php should be used: is it going to be called from other web-pages, or is it a stand-alone app? Is the user going to be bothered if the html-generation becomes the bigger part of the latency?...

xtofl
A: 

Its usually more productive to observe the following:

  • How long database queries take
  • How long it takes to get data from off site requests

... which individually add up to the single page load time. There's no sense in measuring how long a page takes to load if you can't narrow down the bottlenecks.

More than a second or two, someone is likely going to start fiddling with their back or refresh buttons, or just close the browser tab. Again, that's subjective and based on my idea of how a 'typical someone' expects things to work.

Tim Post
Yeap, that was the question, when users start to get annoyed and when they feel weird. From this i can read that you as a user start to take action within 1-2 seconds. So it generally should never take more than 2 seconds.
mardicas