Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Q's on rendering quickly with CGI::Pretty

Status
Not open for further replies.

sanskrit

Programmer
May 30, 2004
3
0
0
US
Hello CGI gurus,

I am having trouble rendering pages from perl fast on the browser. I am developing it for a bio-informatics firm and basically I am using CGI::pretty for html. I did some benchmarking in the code and found that CGI::pretty takes the longest. The data I print on the page is a lot and is colored differently according to the dna it forms. I would appreciate any pointers to improve it.

thanks,
Sanskrit
 
CGI::pretty to my understanding is just formatting the HTML output so that it's indented, newlines, to make more human readable. It's alleged to utilise 25% more bandwidth, (and there would be some implied processing overhead here), than CGI, but the rendered output should still look the same

If its the html output you're after, just use normal CGI.pm, and minimise the amount of print statements, where possible. Also HTML::Template might make life easier.

If it's graphs you're looking for, there are a few modules which can handle graphing on search.cpan.org.

--Paul
 
Hey Paul ,

thanks for the insight... yes the final o/p has to be in html since it is web based... but the browser takes some while before displaying it... also if i select all the features the browser dies... now as i unsderstand there is this much one can do to display things faster as far as html is concd.. i have removed things out of the table , made checks for no errors but yet it takes this much time!!!

Hence I did benchmarking and fnd that cgi:pretty is the culprit... and it is form based so 'pretty' helps. Also I push things in an array and then have a final print stmt so not many prnts either.

HTML::Template, looks like it shd not be a problem. shall try it and let u know.

cheers
Sanskrit

 
Are getting your data from a database or are you loading static pages or files?

There's always a better way. The fun is trying to find it!
 
Hey,

I am loading it from a database.. There is some intense computation going on before printing them on the web page
 
Not sure if this is a problem you're having but keep in mind tables have to load entirely (in Internet Explorer) before any of it will print to the screen. If you have a large database and are printing out tables, this could be a reason for slow load times. It has to wait for the /table> before it prints.
 
print it in chucks then;
<table>
10 rows
</table>

<table>
10 rows
</table>


--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
sloppy, that's the way, ah hah ...
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Your siggy bugs me, lol. What is the last part? What happens when you see someone with a crystal ball? lol. Tell me, pleeeeeeeeeeeeeeeeeeeeease

:)
 
Smack em ... strike em ...

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top