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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I wanna go faster!!

Status
Not open for further replies.

jez

Programmer
Joined
Apr 24, 2001
Messages
370
Location
VN
Hi there,

I have a script running on web server performing a search type facility. It works great but can be a bit slow. This is probably alot to with the server itself (and it's hap-hazard configuration) but I wanted to know if there are any ways I can go about trying to speed up the execution of my script.

The error logs show that although it runs, the script still produces errors...these are mainly "Name main::var-name used only once, poss typo" and it does this for all my global variables...I'm not using Strict, should I and are these errors anything to worry about since the script works?

Any tips on performance would be greatly appreciated.

Many Thanks

Jez
 
While the program is actually in use, it's not necessary to use strict as it just creates extra overhead. However, I would always use it when creating/debugging a program, so you may consider implementing it now (on a copy of the working version ... don't want to break the running code).

Global variables, generally, are not a good thing even though their use is valid in Perl... Hence the pseudo-error. There are a couple of reasons for this:
1. It's easy to forget what variables are currently in use and thus, overwrite them, causing the script to crash, enter an infinite loop, or become terribly depressed.
2. Garbage collection can't touch these variables which can lead to high memory usage and low efficiency. Garbage collection waits for all references to an item to go out of scope ... something global vars don't do until the end of the script.

Why don't you post the code, or a link to the code source so we can better evaluate your options?

brendanc@icehouse.net
 
Thanks for the tips, I have emailed the entire script directly to you FYI.

In the mean time though, now I know the way to use strict I can start making this script a bit more bullet proof.

Anyone who would like to see this script for ideas or whatever please email me ..... jmanse@hotmail.com (mainly because the script is quite long to post here.

Thanks again

Jez
 
You could always use FastCGI Mode. Try fastcgi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top