in reply to slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long))
why are these so slow to import?
Well, if you think about it when you use Pod::Usage it has to parse the source of your code, extract the POD and process the POD to present usage info - that will all take time. You can save this by postponing the load until/unless it is actually needed (most runs will never need it, of course). The other option is to use pod2usage out-of-band in advance and just copy the output of that into your code instead statically.
I find that Getopt::Std is much faster than Getopt::Long. Its reduced functionality may well be worth the trade-off for you.
🦛
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: slow startup for some common modules? (autodie, Pod::Usage, Getopt::Long))
by almr (Sexton) on Dec 28, 2022 at 17:50 UTC | |
by Marshall (Canon) on Dec 29, 2022 at 05:44 UTC | |
by almr (Sexton) on Jan 06, 2023 at 23:08 UTC | |
by LanX (Saint) on Jan 07, 2023 at 02:46 UTC | |
by NERDVANA (Deacon) on Dec 31, 2022 at 07:34 UTC | |
by Anonymous Monk on Dec 28, 2022 at 18:40 UTC |
In Section
Seekers of Perl Wisdom