B-Stats
view release on metacpan or search on metacpan
1) use warnings
which depends on warnings::register and Carp, which loads a whole bunch of big generally unnecessary warnings category hashes. And XSLoader. And B if compiled.
With B::C I introduced -fno-warnings for 5.13.5 to save 68KB executable size on 32-bit.
Uncompiled the number are of course obscenely higher.
2) use Carp
This requires XSLoader and also includes the huge B, at least when compiled.
The biggest hit is the Carp warning when AUTOLOAD a XS module fails. Then Carp is dynaloaded to print the callstack. Printing the callstack in case of dynaloader errors should seriously not be dependent on DynaLoader, it should be provided by the sta...
3) swash_init utf8
utf8_heavy is autoloaded whenever perl needs upper-case/lower-case folding tables. These tables include all unicode tables because we are not ASCII anymore, which are loaded as fat perl tables, not as fast c arrays as e.g. Encode or icu does. Perl mi...
There is no heuristic to check the string for possible non-ascii strings, there is no ascii pragma (no utf8 would be the correct name) to prevent from loading these tables.
With B::C I introduced -fno-fold for 5.13.9 to save 1.6MB executable size on 32-bit
when utf8 folding is not required.
Anyway, I'm now measuring the size of the optree at certain stages with my new module B::Stats. It unfortunately requires B, which itself includes 14 files, 3821 lines and ca. 4883 ops. I have to subtract this constant overhead, similar to a profiler...
#
# t/test.pl - from CORE
sub _where {
my @caller = caller($Level);
return "at $caller[1] line $caller[2]";
}
# runperl - Runs a separate perl interpreter.
# Arguments :
# switches => [ command-line switches ]
# nolib => 1 # don't use -I../lib (included by default)
# prog => one-liner (avoid quotes)
# progs => [ multi-liner (avoid quotes) ]
# progfile => perl script
( run in 0.277 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )