JavaScript-Minifier-XS
view release on metacpan or search on metacpan
xt/author/leaks-xs.t view on Meta::CPAN
function bar() {
return foo + "baz";
}
END_JS
###############################################################################
# Sanity check: minify actually does something.
ok minify($js), 'minify() returned minified JS';
###############################################################################
# Warm things up. Runs a handful of iterations so that our memory allocator
# can reach a steady state.
minify($js) 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($js) for (1 .. $ITERS_TESTING);
( run in 1.696 second using v1.01-cache-2.11-cpan-4ab04211f4c )