From 7321c78ebdcaa7ce5f0f8383e07429827da0b718 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 18 Dec 2019 03:36:45 +0000 Subject: t/run.perl: to avoid repeated process spawning for *.t Spawning a new Perl interpreter for every test case means Perl has to reparse and recompile every single file it needs, costing us performance and development time. Now that we've modified our code to avoid global state, we can preload everything we need. The new "check-run" test target is now 20-30% faster than the original "check" target. --- Makefile.PL | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile.PL') diff --git a/Makefile.PL b/Makefile.PL index 96c5903b..0f50a658 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -168,8 +168,16 @@ dsyn :: \$(addsuffix .syntax, \$(filter \$(changed), \$(syn_files))) check-manifest :: MANIFEST if git ls-files >\$?.gen 2>&1; then diff -u \$? \$?.gen; fi -check:: pure_all check-manifest - \$(EATMYDATA) \$(PROVE) -bvw -j\$(N) +# the traditional way running per-*.t processes: +check-each :: pure_all check-manifest + \$(EATMYDATA) \$(PROVE) --state=save -bvw -j\$(N) + +# lightly-tested way to runn tests, relies "--state=save" in check-each +# for best performance +check-run :: pure_all check-manifest + \$(EATMYDATA) \$(PROVE) -bvw t/run.perl :: -j\$(N) + +check :: check-each lib/PublicInbox/UserContent.pm :: contrib/css/216dark.css \$(PERL) -I lib \$@ \$? -- cgit v1.2.3-24-ge0c7