about summary refs log tree commit homepage
path: root/Makefile.PL
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-18 03:36:45 +0000
committerEric Wong <e@80x24.org>2019-12-19 04:07:50 +0000
commit7321c78ebdcaa7ce5f0f8383e07429827da0b718 (patch)
tree1877bacf3b43494f3d8a10e059fe3309953c6405 /Makefile.PL
parent3c313f9034aac96182e2efdc2f92c40803626f32 (diff)
downloadpublic-inbox-7321c78ebdcaa7ce5f0f8383e07429827da0b718.tar.gz
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.
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL12
1 files changed, 10 insertions, 2 deletions
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 \$@ \$?