Repository navigation
Conversation
pastedWords asked windowsBackslashWord about every word by converting the whole remaining paste to a string and lowercasing it, so a 4,000-line paste (a stack trace, a log) made about 16,000 copies of up to 180KB: quadratic, twenty seconds of CPU on the surface's own goroutine. The question now reads at most the sixteen runes it can recognise. The old splitter's exact output is pinned for drive paths, both WSL UNC hosts, quotes, escapes, mixed lines and the 4,000-line trace. A law in PERF.md holds the paste path linear by BYTES allocated (a count of allocations grows fourfold for the quadratic parser too, one copy per word, and a count-based law passed against it). TestALargePasteIsOneEditAndNoLayout falls from 21s to 0.01s, which was 6% of the whole tui3 suite. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Collaborator
Author
|
Consolidated into #1419, which carries this change unchanged as its own commit alongside the rest of the test-speed wave. |
santoshkumarradha
pushed a commit
that referenced
this pull request
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
What
Pasting a large document into the box froze the surface.
pastedWordsaskedwindowsBackslashWordabout every word by converting the whole remaining paste to a string and lowercasing it. A 4,000-line paste (a stack trace, a log, about 180KB and 16,000 words) made about 16,000 copies of up to 180KB each: quadratic, about twenty seconds of CPU on the surface's own goroutine.TestALargePasteIsOneEditAndNoLayoutmeasured it as 21s, 6% of the whole tui3 suite. Its CPU profile was 47%slicerunetostring, 32%encoderune, 17%strings.ToLower, all underapp.paste.The question now reads at most the sixteen runes it can recognise (
X:\needs three,\\wsl.localhost\sixteen). The rest of the paste path was audited for the same shape: readings are bounded at four, a failed reading stops at its first failed stat, and every other scan is one pass.Proof
TestALargePasteIsOneEditAndNoLayoutkeeps every assertion and falls from 21s to 0.01s.make pr-readygreen (touched./internal/tui3, the whole package serial with-count=1, 317s against 337s before).Part of the test-speed wave with #1394, #1397 and #1398.
🤖 Generated with Claude Code