require vs Module::Load benchmark
Since I often do:
sub some_func {
require Some::CPAN::Module;
....
}
to delay loading of modules, I am interested in how much overhead this introduces.
After first successful require(), the subsequent require()'s of the same module is very fast (around 0.08µ on my PC) because all Perl does is just convert Some::CPAN::Module to Some/CPAN/Module.pm and check this against %INC. This kind of overhead is comparable to that of an empty subroutine call.
If we change the require line to
l…