Skip to content

Multiple entries with intuitively equal keys in PackratReader cache #45

Closed
@tom--k

Description

@tom--k

Even though we use PackratParsers, we've observed exponential parsing time on one of our bit more complicated inputs. It turned out that strange entries get into PackratReader cache; it contained more than one entry for seemingly equal (Parser,Position) pairs.

We've fixed this with a workaround which implements equals method in the OffsetPosition case class so that it does not compare CharSequences. Another working option which seems to be more safe is to compare toString representations of the CharSequences, but that introduces quite significant performance penalty.

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