PureYAML/Sources/Parsing
Mihaela Mihaljevic 7add6f0087 perf(parsing): measure scanStep() overhead, fix a real but partial cause
Add StreamingScannerPerformanceTests (issue #4), gated behind
PUREYAML_STREAMING_PERF_MEASURE=1, measuring scanStep() against scanAll() on
the largest real-world fixture (9.5MB) across a spread of chunk sizes.

Small chunk sizes (16-256 scalars) show a real, chunk-size-dependent rescan
cost, up to 6x at 16, consistent with the checkpoint-and-retry design
rescanning a fetch attempt once per chunk it spans. A control run with
isFinal: true from construction, where ranDry can never be set and no
rollback ever happens, still cost ~1.5x over scanAll(), proving a separate,
chunk-size-independent cost dominates at any realistic chunk size (4KB+): the
checkpoint was being copied on every fetch even when it could never be used.

Fixed by skipping the checkpoint entirely when reader.isFinal is true.
Re-measured rather than assumed fixed: the isolated control improved from
1.49x to 1.38x, a real but modest gain, while the large-chunk-size ratios
were unchanged within measurement noise. The remaining floor's cause is not
identified and is left open on issue #4 rather than patched further on
speculation; closing it needs a profiler, not another guess.

Whole-suite conformance (402/402) and the chunk-size differential proof both
still pass unchanged.
2026-07-10 00:14:19 +02:00
..
BlockScalarChomping.swift fix(parsing): classify the keep block-scalar chomping indicator 2026-06-26 07:50:07 +02:00
BlockScalarStyle.swift
CollectionStyle.swift
Event.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
EventComposer.Merge.swift refactor(parsing): share merge-key resolution between composers 2026-06-26 05:50:28 +02:00
EventComposer.swift Merge conformance/yaml-test-suite-gaps: the libyaml port becomes the engine on main 2026-07-05 00:23:48 +02:00
EventStreamComposedNode.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
EventStreamComposer.Located.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
EventStreamComposer.swift Merge conformance/yaml-test-suite-gaps: the libyaml port becomes the engine on main 2026-07-05 00:23:48 +02:00
EventStreamComposerMode.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
EventStreamContainer.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
EventStreamContainerKind.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
LibYAML.CharacterClass.swift fix(parsing): treat flow '?' before a non-indicator as scalar content 2026-06-24 18:50:46 +02:00
LibYAML.IndentEngine.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.NodeProperties.swift feat(parsing): port libyaml parser state machine to Swift 2026-06-24 17:05:59 +02:00
LibYAML.Parser.Block.swift feat(parsing): parse block mappings with empty keys 2026-06-24 18:27:45 +02:00
LibYAML.Parser.Directives.swift feat(parsing): run the whole library on the ported engine 2026-06-24 18:02:22 +02:00
LibYAML.Parser.Document.swift fix(parsing): reject misplaced directives, refresh suite manifest 2026-06-24 19:51:39 +02:00
LibYAML.Parser.Flow.swift fix(parsing): parse a leading ':' flow-sequence entry as an empty-key pair 2026-06-24 19:07:04 +02:00
LibYAML.Parser.Helpers.swift feat(parsing): port libyaml parser state machine to Swift 2026-06-24 17:05:59 +02:00
LibYAML.Parser.Node.swift feat(parsing): exact scalar end positions in the located parse 2026-06-26 02:25:01 +02:00
LibYAML.Parser.swift feat(parsing): exact scalar end positions in the located parse 2026-06-26 02:25:01 +02:00
LibYAML.ParserError.swift feat(parsing): port libyaml parser state machine to Swift 2026-06-24 17:05:59 +02:00
LibYAML.ParserState.swift feat(parsing): port libyaml parser state machine to Swift 2026-06-24 17:05:59 +02:00
LibYAML.Reader.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.Anchor.swift feat(parsing): accept full YAML 1.2 anchor and alias names 2026-06-24 18:11:58 +02:00
LibYAML.Scanner.BlockScalar.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.Directive.swift fix(parsing): reject misplaced directives, refresh suite manifest 2026-06-24 19:51:39 +02:00
LibYAML.Scanner.Fetch.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.FlowScalar.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.Guards.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.PlainScalar.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.SkipToToken.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.Streaming.swift perf(parsing): measure scanStep() overhead, fix a real but partial cause 2026-07-10 00:14:19 +02:00
LibYAML.Scanner.swift feat(parsing): add a resumable scanner increment and broaden the mutation suite 2026-07-09 23:38:39 +02:00
LibYAML.Scanner.Tag.swift feat(parsing): port libyaml tag scanner to Swift 2026-06-24 16:48:22 +02:00
LibYAML.ScannerError.swift feat(parsing): port libyaml simple-key mechanism to Swift 2026-06-24 02:55:07 +02:00
LibYAML.SimpleKey.swift fix(parsing): accept tabs as separation, reject them as indentation 2026-06-24 19:14:12 +02:00
LibYAML.swift feat(parsing): begin faithful libyaml scanner port (indent engine) 2026-06-24 02:46:29 +02:00
LibYAML.Token.swift feat(parsing): begin faithful libyaml scanner port (indent engine) 2026-06-24 02:46:29 +02:00
LibYAML.TokenType.swift feat(parsing): run the whole library on the ported engine 2026-06-24 18:02:22 +02:00
Mark.swift
MergeResolution.swift refactor(parsing): share merge-key resolution between composers 2026-06-26 05:50:28 +02:00
NodeKind.swift feat(parsing): parse token stream into events 2026-06-05 09:56:18 +02:00
ParseError.LibYAML.swift feat(parsing): run the whole library on the ported engine 2026-06-24 18:02:22 +02:00
ParseError.swift fix(parsing): reject a document marker inside a multi-line scalar 2026-06-27 23:20:52 +02:00
Parser.Events.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
Parser.ScalarComposition.swift Merge conformance/yaml-test-suite-gaps: the libyaml port becomes the engine on main 2026-07-05 00:23:48 +02:00
Parser.swift feat(parsing): opt-in located parse on the hand-rolled engine 2026-06-29 07:14:42 +02:00
Reader.swift feat(parser): harden diagnostics and streaming 2026-06-06 07:57:48 +02:00
Scalar.swift fix(parsing): enforce the full YAML 1.2 double-quoted escape table 2026-06-27 16:19:25 +02:00
ScalarStyle.swift feat(parsing): compose events into values 2026-06-05 10:07:28 +02:00
TagNormalizer.swift feat(tagged): add tag-preserving validation 2026-06-05 15:35:52 +02:00
Text.swift feat(parsing): compose events into values 2026-06-05 10:07:28 +02:00