in reply to Re^5: Directory creation with current Date
in thread Directory creation with current Date

Hello,

Well, I do care, since this is a question that arises a lot at work, that is: module load times. From previous discussions i gathered that modules take almost zero time to load, especially compared to system calls (that was the origin of the argument, it led to the use of Archive::Tar and others ) .

if you use a nontrivial selection of modules the likely that POSIX gets loaded anyway is pretty high

That's a good point, but the fact is that I mainly do system administration and installing more module "just for me" is forbidden. So i only use standard distribution modules, on my current project at least. (granted, these could also, maybe, load posix ! )

probably reduce your run times (I admit I havent benchmarked),

System load is the most important point for me, as in everything system.
I believe POSIX has quite a lot of things in it, and i'm ready to had a few more lines in trade of the mere possibility that i gain something on that aspect.
Maybe i could use POSIX qw(strftime) , but i do not know how this stands in load time difference compared to the whole use posix . Do you know ?

Now if i really needed POSIX for something, i would use it. But only to format a date string ? Is it not using posix only for this that would make the code as a whole bloated ? .

Anyway, I note the points you make on good practice since it's a very important subject where i certainly need more advice

Cheers,

ZlR.

  • Comment on Re^6: Directory creation with current Date

Replies are listed 'Best First'.
Re^7: Directory creation with current Date
by demerphq (Chancellor) on Jan 19, 2005 at 22:35 UTC

    Well, loading POSIX which is an XS/C module is afaik pretty light. You could always put something like

    END { use Data::Dumper; print Dumper(\%INC); }

    in one of your modules and have a look at what is loaded. Id guess you'd be surprised. :-)

    Is it not using posix only for this that would make the code as a whole bloated ? .

    How does

    use POSIX qw(strftime); print strftime "%Y-%m-%d",localtime(time);

    Make your code bloated? Id bet the optrees and the rest created by your code to do the same thing are actually a lot bigger footprint than the precompiled from C POSIX library. Also, of the two which would you prefer to maintain?

    Now look, if you are writing scripts for a high usage web set, or something that has to have really fast load times then fine we can quibble about loading POSIX or something like it. But for the rest of the time I dont really see much room for even thinking about how long modules load, almost any task that is hard to do will take so much longer than the load time that its not worth caring.

    ---
    demerphq