1
0
forked from GitHub/gf-core
Files
gf-core/testsuite/lpgf
John J. Camilleri 5ad5789b31 Filter out record fields which don't exist in lintype
This is to work around an inconsistency in the canonical representation
2021-02-19 15:19:40 +01:00
..
2021-02-16 15:17:54 +01:00
2021-02-16 15:17:54 +01:00
2021-02-16 15:17:54 +01:00
2021-02-16 22:49:37 +01:00
2021-02-13 00:16:03 +01:00
2021-02-09 10:54:51 +01:00
2021-02-16 22:49:37 +01:00
2021-02-09 10:54:51 +01:00
2021-02-09 10:54:51 +01:00
2021-02-13 00:14:35 +01:00
2021-02-03 13:16:10 +01:00
2021-01-26 09:35:21 +01:00
2021-02-03 09:44:15 +01:00
2021-01-26 09:35:21 +01:00
2021-01-26 09:35:21 +01:00

LPGF testsuite & benchmark

Test

LPGF must be equivalent to PGF in terms of linearisation output.

Possible exceptions:

  • No handling of variants (design choice)
  • Rendering of missing fucntions

Running

stack build --test --bench --no-run-tests --no-run-benchmarks
stack test gf:test:lpgf # all LPGF tests
stack test gf:test:lpgf --test-arguments="Params" # specific grammar
stack test gf:test:lpgf --test-arguments="Foods Fre Ger" # specific grammar and languages

Benchmark

Compilation

Comparing PGF, LPGF along following criteria:

  • Time
  • Memory
  • Binary file size

Runtime (linearisation)

Comparing PGF, PGF2, LPGF along following criteria:

  • Time
  • Memory

Running

Run each command separately so that memory measurements are isolated. The +RTS -T -RTS is so that GHC can report its own memory usage.

stack build --test --bench --no-run-tests --no-run-benchmarks
stack bench --benchmark-arguments "compile pgf  testsuite/lpgf/Foods*.gf +RTS -T -RTS"
stack bench --benchmark-arguments "compile lpgf testsuite/lpgf/Foods*.gf +RTS -T -RTS"
stack bench --benchmark-arguments "run pgf  Foods.pgf  testsuite/lpgf/foods-all.trees +RTS -T -RTS"
stack bench --benchmark-arguments "run pgf2 Foods.pgf  testsuite/lpgf/foods-all.trees +RTS -T -RTS"
stack bench --benchmark-arguments "run lpgf Foods.lpgf testsuite/lpgf/foods-all.trees +RTS -T -RTS"