CSS-Minifier-XS
view release on metacpan or search on metacpan
xt/author/leaks-xs.t view on Meta::CPAN
###############################################################################
# CSS input that triggers the leak: a string that minifies down to no nodes.
my $css = '/* */';
###############################################################################
# Sanity check: minify() of the test CSS returns nothing (as it was all
# minified away).
is minify($css), undef, 'minify() of empty CSS returns undef';
###############################################################################
# Warm things up. Runs a handful of iterations so that our memory allocator
# can reach a steady state.
minify($css) for (1 .. $ITERS_WARMUP);
###############################################################################
# Measure RSS growth over repeated calls to the minifier. If the XS code is
# leaking any memory, our RSS should grow.
my $smaps = Linux::Smaps->new;
my $rss_before = $smaps->update->rss;
minify($css) for (1 .. $ITERS_TESTING);
( run in 0.600 second using v1.01-cache-2.11-cpan-f03e8824b8d )