Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 13223
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: perl [...] jochen-stenzel.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: CGI::Pretty dramatically can slow down operation dramatically
Download (untitled) / with headers
text/plain 502b
Hello, using CGI::Pretty can slow down operation dramatically. According to Devel::Profile a script ready after about 5 seconds without CGI::Pretty took more than 80 seconds with this module. The delay became obvious after inserting a generic dropdown with about 500 entries. The only code difference between the versions was the inclusion of "use CGI::Pretty". CGI: 3.07 and 3.10. perl: 5.8.6 (no threading, no multiplicity, 32 bit). OS: Solaris 5.8. Thanks in advance Jochen
Download (untitled) / with headers
text/plain 928b
Thanks for the report, Jochen. I'm sorry it took so long to get a reply through the bug tracker. Would you be willing to retest with a current version of CGI::Pretty to see what the speed difference is these days? It would good to add a statement to the docs about what the expected slow down might be. Mark On Mon Jun 13 11:11:39 2005, JSTENZEL wrote: Show quoted text
> > Hello, > > using CGI::Pretty can slow down operation dramatically. According to > Devel::Profile a script ready after about 5 seconds without > CGI::Pretty took more than 80 seconds with this module. The delay > became obvious after inserting a generic dropdown with about 500 > entries. > > The only code difference between the versions was the inclusion of > "use CGI::Pretty". > > CGI: 3.07 and 3.10. > perl: 5.8.6 (no threading, no multiplicity, 32 bit). > OS: Solaris 5.8. > > Thanks in advance > > Jochen > > > >
Download (untitled) / with headers
text/plain 565b
This is my shot at a benchmark. I'm not pretending this is accurate, but it was the first way I found to pitch CGI against CGI::Pretty that actually worked. #!/opt/perl/bin/perl use Benchmark qw(cmpthese); cmpthese( 10, { cgi => 'system($^X, "-e", "use CGI qw(:html3); my \$f = table(map { TR(map { td(\$_) } 1..100) } 1..10);");', pretty => 'system($^X, "-e", "use CGI::Pretty qw(:html3); my \$f = table(map { TR(map { td(\$_) } 1..100) } 1..10);");', }); __END__ Rate pretty cgi pretty 1.81/s -- -90% cgi 17.2/s 853% --
Download (untitled) / with headers
text/plain 545b
Thanks, I've now pushed a patch to my github repo with a new documentation section to address this: =head2 Recommendation for when to use CGI::Pretty CGI::Pretty is far slower than using CGI.pm directly. A benchmark showed that it could be about 10 times slower. Adding newslines and spaces may alter the rendered appearance of HTML. Also, the extra newlines and spaces also make the file size larger, making the files take longer to download. With all those considerations, it is recommended that CGI::Pretty be used primarily for debugging.
Subject: Thanks, released
Download (untitled) / with headers
text/plain 160b
The patch for this ticket has now been released in CGI.pm 3.47, and this ticket is considered resolved. Thanks again for you help to improve CGI.pm! Mark


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.