Assuming that your script is going to be able to produce some output immediately, and then some more after some delay through DB access or similar?
Depending upon the type of formatting of your HTML, some (most?) browsers will be able to start to render the page from the partial output from the early prints therebye giving the user a feeling that things are happening. This can be advantagous.
If you save it all up and print it all in one go, it may result in a longer delay before the browser starts to render something, which may cause the perception of a slower site than they might otherwise have.
This effect is particularly noticable when rendering large volumes of data in tables. If the rows are sent in separate chunks--and if the sizes of the cells are predefined--then most browsers will be able to render the table in chunks, rather having to wait for the whole table to arrive before being able to render anything.
This is one of those cases were perceived performance is probably more important that absolute performance.
In reply to Re: Many prints of small string or one print of huge string?
by BrowserUk
in thread Many prints of small string or one print of huge string?
by dmitryrusak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |