Repository navigation
Share UTF-8 text snapshots and reduce text editing allocations - #115
Merged
Merged
Conversation
elcritch
force-pushed
the
feat/shared-utf8-text-snapshot-v2
branch
from
September 23, 2026 01:58
51cc957 to
1cb60c4
Compare
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.
Summary
TextByteRangefor parser/layout endpoints, with explicit snapshot conversions. Snapshots provide rune indexing/iteration without materializing a sequence;toRunes()remains available when a decoded sequence is useful.TODO-utf8runes.md.Dependency
Depends on elcritch/figdraw#93: elcritch/figdraw#93
merenda.nimblepoints to FigDraw'sfeat/borrowed-utf8-text-spansbranch with the existingsiwin,sharedlib, andharfbuzzfeatures. Atlas resolves that branch atca08508. The FigDraw PR contains the borrowed-span API, compatibility fixes, an RSS benchmark, and FigDraw 0.42.0.Verification
atlas-run tests: 4/4 runners passed after the public API additions. Focusedatlas-run tests tnimkitalso passed (1/1).dd933623(median of three fresh processes): 8 MiB gap edit with undo disabled, +20,816 to +4,384 KiB RSS; enabled, +20,864 to +12,640 KiB; SynEdit tokenization of 8 MiB spaces, +81,968 to +8,208 KiB. Applying 2,048 styles over 1 MiB used +1,440 versus +1,312 KiB RSS, while operation time fell from about 0.336 to 0.006 seconds.toRunes()added 16,432 KiB. These are process RSS observations, not allocation counts.atlas-run tests --compile-only examples/all_compile.nim: 1/1 compiled.nim r tests/nimkit/styledruns.nim: passed. An earlier standalone 8 MiB / 8,192-run sample reported borrowed spans +400 KiB RSS and owned runs +12,240 KiB after storage. RSS is diagnostic; the shared NimKit runner can report zero growth when it reuses resident pages.