Skip to content

perf: keep translation time linear in document size - #93

Open
FagnerMartinsBrack wants to merge 1 commit into
crosstype:masterfrom
FagnerMartinsBrack:perf/linear-output-building
Open

FagnerMartinsBrack wants to merge 1 commit into
crosstype:masterfrom
FagnerMartinsBrack:perf/linear-output-building

Conversation

@FagnerMartinsBrack

Copy link
Copy Markdown

Hey there!

The visitor re-read the whole output string on every append, so translation time grew quadratically. Output is now kept as a list of parts with a running length. Output is identical to the original; I added some new tests that pin each boundary of output building plus a scaling test if you want to keep it.

The visitor re-read the whole output string on every append, so translation time grew quadratically.
Output is now kept as a list of parts with a running length and a short tail for the whitespace lookback.
Output is byte-identical; new tests pin each boundary of output building plus a scaling test.
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.

1 participant