Skip to content

Parser speedup 1#73

Draft
timo wants to merge 2 commits intomainfrom
parser_speedup_1
Draft

Parser speedup 1#73
timo wants to merge 2 commits intomainfrom
parser_speedup_1

Conversation

@timo
Copy link
Contributor

@timo timo commented Feb 26, 2025

Make the grammar faster and also correcter.

timo added 2 commits February 26, 2025 19:36
The fact that both xmldecl and doctypedecl were optional and had
the comment and pi tokens after them with a star, a failure to reach
the end of the file to get the $ to match, will shuffle match
attempts between the first and second line ...

One first step in making the parser fail faster when encountering
an invalid document.
Better from a performance standpoint because of less opportunities
to backtrack, but also prevents comments from including their stopper
and other stuff up until another comment or pi stopper is seen.
@timo timo marked this pull request as draft February 26, 2025 19:14
@timo timo mentioned this pull request Feb 26, 2025
@2colours
Copy link
Contributor

2colours commented Feb 9, 2026

@timo do you think this PR has a future? Or alternatively, could it just be merged as-is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants