Skip to content

P13: Move LintCache.store off the lint critical path #555

@Jason-Abbott

Description

@Jason-Abbott

Location: Sources/Swiftiomatic/Frontend/LintFrontend.swift:104Sources/SwiftiomaticKit/Support/LintCache.swift (store)

After lint completes for a file, store performs a JSON encode + atomic file write inline, blocking the per-file worker thread. Across hundreds of files in parallel, every worker is doing synchronous I/O after every lint.

Potential performance benefit

When --parallel is on, each worker that finishes a clean file blocks on disk write before picking up the next file. Moving writes to a single background actor (or batching one write per N files / at end-of-run) frees workers to immediately start the next file. The benefit scales with miss-rate × file-count and is most visible on full first runs.

Reason deferred

Needs a small architecture: a Sendable write queue (AsyncStream<WriteRequest> consumed by a detached task, or a simple actor). Has to handle process exit cleanly so pending writes flush. Unit tests for ordering and crash-safety required.

👾 This issue is managed by Jig. Edits made here will be overwritten.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions