When you import some function or variable you just make a reference in you package to the module package. Soo, when you import you create a new entry in the STASH of the package, what use more memory, but not soo much.

A reference in your package will be faster to run, since it doesn't need to look in a different STASH to find the reference, but this is again not soo much faster.

I recomend to always import what you need, and to not use the full path until the module package. But if you want to exclude some automatically imported stuffs, this will be good only if what you are excluding is an amount bigger than what you really need. Soo, if you want to exclude only 2 or 5 methods, this is not much better than just let to import the defaults. But if you want only 2 references, and the module exports by default 20 references, well, will be good to only get the 2 that you need.

But note that this will make differences only when you load the module, soo, think always if the work pay enough to be done. In other words, when talking about programms, you should spend time optimizing only when you really win memory or speed. Soo, keep your eyes in the codes that are executed a lot, like loops, or that takes more time, like read an IO.

Good luck.

Graciliano M. P.
"Creativity is the expression of the liberty".


In reply to Re: use Module - to exclude or not to exclude... by gmpassos
in thread use Module - to exclude or not to exclude... by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.