Protect against quadratic generated table size explosion #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #145
This commit adds a limit to the number of auto-completed cells around 200,000. The result is, in these original samples:
This is unchanged.
This, however, is much lower. The parser is refusing to parse the row where the limit is hit, and switches to parsing it as text instead.
It's not quadratic any more (without this commit, it was 1000230062).
At the limit, 200,000 autocompleted rows is approximately
"</td><td>".len * 200000
generated data, or 1.8Mbyte of data. The above examples show about 2Mbytes, thanks to the row tags and text overhead, and when the parser breaks out of the table it's still including the remaining "rows" as text.