Skip to content

Avoid doing a true file seek for simple peeking in the token parser - #1188

Merged
BobLd merged 1 commit into
UglyToad:masterfrom
rhuijben:feat/peek-char
Oct 20, 2025
Merged

BobLd merged 1 commit into
UglyToad:masterfrom
rhuijben:feat/peek-char

Conversation

@rhuijben

Copy link
Copy Markdown
Contributor

A seek on a plain filestream is handled by the OS so has some overhead. We can easily avoid that.

Handle the normal peek, and also use this code in the EOL detection that did its own peeking by using seek.
(Shaves a few percent of the time running the test suite for me).

Also allow opening a pdf from a ReadOnlyMemory object without using .ToArray().

@BobLd
BobLd merged commit 6fba565 into UglyToad:master Oct 20, 2025
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