[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Any performance issue if too many module is use

Posted on 2002-04-07
1
Medium Priority
?
142 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 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Six Sigma Control Plans
Suggested Courses

834 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