Performance and memory use are two areas of concern for many libraries. Last December I made a number of changes in my Math::Prime::Util module to reduce memory use, and bulk88 helped really tweak some of the XS. I thought I'd pick a simple task and look at the speed and memory use of a number of solutions.
|2096k||72.6s||Perl trial division mod 6|
|2100k||124.8s||Perl trial division|
|4040k||1.9s||Math::Prime::Util (no GMP backend)|
|4388k||1.9s||Math::Prime::Util (with GMP backend)|
|4568k||1.4s||Math::Prime::Util (GMP + precalc)|