Skip to content

v2024.1010.183549

Compare
Choose a tag to compare
@github-actions github-actions released this 10 Oct 18:35
· 4 commits to master since this release
78901f9
Cache the generated parser tables as a .py file (#196)

This change adds a checked in, cached copy of the parser tables,
which will normally be used instead of generating a fresh set of
tables.  On my machine, this saves approximately 2.05s on first
run of `embossc`, and 4.96s after `.pyc` files have been generated.

For a small `.emb` file, those savings translate to approximately 36%
and 87% of the current total runtime, respectively.

In order to minimize frustrating cache decoherence problems, there are
two additional features:

*   When loading the cached parser, the set of grammar productions that
    were used to generate the cached parser is compared to the current
    set.  If they do not match, the cached parser is ignored, and a
    fresh parser is generated.  This allows developers to work on
    `module_ir.py` without manually regenerating the parser tables on
    every change.
*   The new `cached_parser_is_up_to_date_test` will fail if the cached
    parser text is not an *exact* match for the text that would be
    generated from a fresh run of `generate_cached_parser`.  This
    ensures that the version of `cached_parser.py` that is in the
    master Emboss repo is always up to date, no matter what might have
    changed in the source tree.