Skip to content

Optimizing parsers for arrays of constant-size elements without actions #125

@nikswamy

Description

@nikswamy

If one writes UINT32 t[:byte-size n], we actually generate a while-loop to validate each UINT32 advancing by 4 bytes each time. This is inefficient, since one could instead just check that n % 4 == 0 and skip over the array.

We already have an optimized combinator for integer types without refinements or actions, see
EverParse3d.Actions.Base.validate_nlist_constant_size_without_actions, but the interpreter does not seem to use it.

We should enhance the 3D interpreter to use the computed kinds and target this optimized combinator, i.e., relying on parser_kind_is_constant_size in TranslateForInterpreter.fst

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions