Solved

Any performance issue if too many module is use

Posted on 2002-04-07
1
132 Views
Last Modified: 2010-03-05
I have a standard config file that is use in most of my cgi script. In the configuration I have add a list of module. However not all my cgi script are using all the module declare in the config file.

I would like to know if I add more module as time goes by, will those cgi script that use only one or 2 of the module get slow down by loading that many module through the config file?

Below is sample config file and a sample cgi script that I used.

Sample cgi script (test.cgi)
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
use CGI qw(:standard);
warningsToBrowser(1);
require 'config.pl';

print header;
print "Testing only";
print end_html;


Sample config file (config.pl)
#!/usr/bin/perl
######################
# Declare module use #
######################

use DBI;
use Time::Local;
use HTML::Template;
use Image::Size ':all';  
use Image::Magick;
use File::Path;
use Net::SMTP;

0
Comment
Question by:ghgan
1 Comment
 
LVL 12

Accepted Solution

by:
geotiger earned 20 total points
ID: 6926549
The answer is YES. The more module that you import, it takes longer to start the program and uses more memory.

It is because that use imports some semantics into the current package from the named module, generally by aliasing certain subroutine or variable names into your package.  It is exactly equivalent to

  BEGIN { require Module; import Module LIST; }

except that Module must be a bareword.


Geotiger.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now