diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-10-08 12:13:31 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-10-11 22:50:42 +0100 |
commit | e5fefb4e1448d77ce393ea85991e0aa41f17225b (patch) | |
tree | d9c274831c5f5ecd4f193214f30a6b8bb701f74b | |
parent | 0aa38ce7650b8602ed7ee1975ccffb6db59e0ce3 (diff) | |
download | haskell-e5fefb4e1448d77ce393ea85991e0aa41f17225b.tar.gz |
Add GHCi recompilation performance test
-rw-r--r-- | testsuite/tests/perf/compiler/MultiLayerModulesDefsGhci.script | 5 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 13 | ||||
-rwxr-xr-x | testsuite/tests/perf/compiler/genMultiLayerModulesDefs | 26 |
3 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/MultiLayerModulesDefsGhci.script b/testsuite/tests/perf/compiler/MultiLayerModulesDefsGhci.script new file mode 100644 index 0000000000..e3df435f5d --- /dev/null +++ b/testsuite/tests/perf/compiler/MultiLayerModulesDefsGhci.script @@ -0,0 +1,5 @@ +:l shell.hs +:def shell (\s -> do shell s; return "") +:l MultiLayerModules.hs +:shell find . -name 'Dummy*.hs' -exec sh -c 'echo "" >> {}' \; +:l MultiLayerModules.hs
\ No newline at end of file diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 6876060978..b61ba25478 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -293,6 +293,19 @@ test('MultiLayerModulesRecomp', multimod_compile, ['MultiLayerModules', '-v0']) +test('MultiLayerModulesDefsGhci', + [ collect_compiler_residency(15), + pre_cmd('./genMultiLayerModulesDefs'), + extra_files(['../../ghci/shell.hs', 'genMultiLayerModulesDefs']), + compile_timeout_multiplier(5) + # this is _a lot_ + # but this test has been failing every now and then, + # especially on i386. Let's just give it some room + # to complete successfully reliably everywhere. + ], + ghci_script, + ['MultiLayerModulesDefsGhci.script']) + test('ManyConstructors', [ collect_compiler_stats('bytes allocated',2), pre_cmd('./genManyConstructors'), diff --git a/testsuite/tests/perf/compiler/genMultiLayerModulesDefs b/testsuite/tests/perf/compiler/genMultiLayerModulesDefs new file mode 100755 index 0000000000..8dd1d92fd9 --- /dev/null +++ b/testsuite/tests/perf/compiler/genMultiLayerModulesDefs @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Generate $DEPTH layers of modules with $WIDTH modules on each layer +# Every module on layer N imports all the modules on layer N-1 +# Each module has $DEFS definitions in +# MultiLayerModules.hs imports all the modules from the last layer +DEPTH=3 +WIDTH=3 +DEFS=1000 +for i in $(seq -w 1 $WIDTH); do + echo "module DummyLevel0M$i where" > DummyLevel0M$i.hs; +done +for l in $(seq 1 $DEPTH); do + for i in $(seq -w 1 $WIDTH); do + echo "module DummyLevel${l}M$i where" > DummyLevel${l}M$i.hs; + for j in $(seq -w 1 $WIDTH); do + echo "import DummyLevel$((l-1))M$j" >> DummyLevel${l}M$i.hs; + done + for k in $(seq -w 1 $DEFS); do + echo "a_${l}_${i}_${j}_${k} = ${l} + ${i} + ${j} + ${k}" >> DummyLevel${l}M$i.hs; + done + done +done +echo "module MultiLayerModules where" > MultiLayerModules.hs +for j in $(seq -w 1 $WIDTH); do + echo "import DummyLevel${DEPTH}M$j" >> MultiLayerModules.hs; +done |