Scalability Impacts of Multiple Print Calls

It’s common to assume that making multiple print calls to send data to the client is resource-intensive. Such an assumption is also logical. Sending data in small segments causes a scalability problem because of the overhead of generating the packets and headers for them. PHP with the default settings buffers print calls. Nothing is sent to the client until the entire page has been generated. Which is quicker, making many calls to the print function, or appending strings together and making fewer calls to print? Figure 1-7 illustrates the effect that both approaches can have. The generated page contains a table of three columns and 57 rows. Using the high print method in which each row is printed out ...

Get Oracle Database Ajax & PHP Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.