?
Solved

Any performance issue if too many module is use

Posted on 2002-04-07
1
Medium Priority
?
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
geotiger earned 60 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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 …
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…
Six Sigma Control Plans
Suggested Courses

765 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