Skip to content

Cut per-field allocations in the byte parser, add Swift 6.4 CI - #7

Merged
RISCfuture merged 4 commits into
mainfrom
swift-6.4/modernization
Sep 15, 2026
Merged

RISCfuture merged 4 commits into
mainfrom
swift-6.4/modernization

Conversation

@RISCfuture

Copy link
Copy Markdown
Owner
  • Removes a heap allocation per parsed field. toString()/toRawString() each called Array(self), across ~101 sites and hundreds of thousands of records.
  • Typed throws on the line reader's async iterator.
  • Adds Swift 6.4 CI legs.

The 229 .slice( sites are deliberately untouched: that helper returns its subsequence across a function boundary, which would require @lifetime — still experimental in 6.4. Parse output verified byte-identical.


🤖 Generated with Claude Code

https://claude.ai/code/session_01EbZbx5D2gGeXT8UxuiKEdq

@RISCfuture
RISCfuture force-pushed the swift-6.4/modernization branch 2 times, most recently from 1719b55 to ea669f3 Compare September 14, 2026 23:06
RISCfuture and others added 4 commits September 14, 2026 20:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EbZbx5D2gGeXT8UxuiKEdq
Decode CIFP fields through UTF8Span over the slice's own storage instead of
copying each field into an Array first. `toString()`/`toRawString()` run on
roughly 101 call sites per record across hundreds of thousands of records, so
the per-field allocation dominated the string side of parsing; the new form is
about 2.3x faster on a field-decode microbenchmark and produces byte-identical
output (verified exhaustively over all one- and two-byte sequences plus 400k
random and ASCII-biased fields, and end-to-end against a 60k-record synthetic
corpus under SWIFT_DETERMINISTIC_HASHING).

Give both async line reader iterators typed throws. The file-backed reader now
throws `CIFPError.streamError`, wrapping the underlying `FileHandle` failure,
which makes `CIFP(url:)` match its documented contract of throwing `CIFPError`.
The generic byte-sequence reader propagates its source's `Failure` type, so a
non-throwing source now yields a non-throwing sequence.

Add Swift 6.4 CI legs on macOS and Linux, and drop the matrix policy comment
that flagged the bump as pending.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EbZbx5D2gGeXT8UxuiKEdq
`main` lowered this package's floor to what its code there requires. The
byte-parsing work on this branch uses `UTF8Span`, which is macOS 26, so the
branch declares the floor its own code needs.

Merging this therefore raises the floor. That is the trade the branch asks
for and it should be decided on the merge, not worked around in the source.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EbZbx5D2gGeXT8UxuiKEdq
Enable `.strictMemorySafety()` (SE-0458) alongside the existing upcoming
feature flags and audit every unsafe construct it surfaces, marking each
with the `unsafe` expression marker.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EbZbx5D2gGeXT8UxuiKEdq
@RISCfuture
RISCfuture force-pushed the swift-6.4/modernization branch from 0dbf369 to 42522b0 Compare September 15, 2026 03:08
@RISCfuture
RISCfuture merged commit 9ff1719 into main Sep 15, 2026
8 checks passed
@RISCfuture
RISCfuture deleted the swift-6.4/modernization branch September 15, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant