Closed atoomic closed 8 years ago
Thanks for the participating. But I think that these are micro optimizations which are only relevant for minimal programs. With typical programs the effect will be minimal. And they might even cause harm for more complex programs or lead to increased memory usage:
Avoid import of Carp, only load it when required. Avoid importing everything from IO::Socket / Socket. Hide to the compiler the regexp with \w when using SSL_fingerprint. This is bringing some extra memory for no real advantages.
(master) > export A='use IO::Socket::SSL (); print qx{grep VmRSS /proc/$$/status}'; p14 -Ilib -e "$A"; p22 -Ilib -e "$A" VmRSS: 5940 kB VmRSS: 7460 kB
(devel/memory-improvement) > export A='use IO::Socket::SSL (); print qx{grep VmRSS /proc/$$/status}'; p14 -Ilib -e "$A"; p22 -Ilib -e "$A" VmRSS: 5856 kB VmRSS: 6752 kB