in reply to Re: CGI print statements taking forever
in thread CGI print statements taking forever

Yep, tried that, and I've also tried :
print $content{'menu'}; print $content{'body'}; print $content{'footer'};
and
print <<HTML; $content{'menu'} $content{'body'} $content{'footer'} HTML
All solutions only shaving milliseconds off the total time.

Replies are listed 'Best First'.
Re^3: CGI print statements taking forever
by jhourcle (Prior) on Jun 27, 2005 at 13:35 UTC

    If you've gotten it down to that particular block of code, can you manage to break it down further, and track down exactly which line is the worst offendor?

    The only times I've seen print be a major problem was when I was passing around rather large strings through a series of functions (by 'rather large', they were in excess of a 500k), concatinating as it went through the functions.) -- so it wasn't really the print, it was the concatination, and assigning large strings based on the return of the functions. We changed the logic so we were passing around an array of strings, and printing that, and it shaved a few seconds off our time.

    Also, be careful of the "<<HTML" example that you've given -- it would also insert extra line returns (probably not an issue for HTML, but could be an issue for other situations