Repository navigation
Fix quadratic processing time in the tables extension for long blocks - #1704
Open
deadstrobe5 wants to merge 1 commit into
Open
deadstrobe5 wants to merge 1 commit into
deadstrobe5 wants to merge 1 commit into
Conversation
Member
|
I think maybe we should add a couple additional tests to ensure we are not breaking the existing behavior. # Table
| A | B |
|---|---|
| a | b |
Not a table
| A | B |
|---|---|
| a | b |We want to ensure that the first one is properly recognized as a table and the second is not. Based on the code, I expect the second to pass, but I am concerned that the first may not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
TableProcessor.testsplits and strips every line of the block, but only the first two rows are needed outside the single-column-with-border case. Blocks that other processors take apart one line at a time, such as headers with no blank lines between them, return the rest of the block to be tested again, so the table test alone made those blocks quadratic.tablesis enabled by default in MkDocs.This splits off only the first two rows. The single-column case, which checks that every row has a pipe, still reads all the rows.
Median of 5 alternating runs in one process, CPython 3.14, extensions
toc,tablesandfenced_code:# HThe old and new code give the same HTML on 30,000 generated documents mixing tables, single-column tables, headers, lists and other blocks.
AI Assistance Disclosure
No AI tools were used in preparing this PR.
AI tools were used and I have disclosed which ones, and have fully reviewed and verified their output.
Claude Code (Claude Opus 5.5) was used for everything ticked below. The review attestation in the box above is left for the human submitter.
AI tools were use to assist with the following:
Checklist