Skip to content

Performance issue #331

@NaN-git

Description

@NaN-git

Description

When parsing YAML without line breaks and with many scalars, then the parser becomes arbitrary slow. Often JSON has such a format.

The cause of the issue seems to be this line of code. I don't understand the purpose of the check, but it causes the scanning of the whole line, if the line contains no \r-character, i.e. the complexity to scan the line becomes #scalars x #characters. Removing the check (for testing) fixes the performance issue for my test case. The same check appears in other functions, too, i.e. those functions will be affected, too.

It seems to be a mistake that the scan starts outside of the scalar at the end of the line because the filtering is applied to the scalar only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions