Repository navigation
Faster, and three fixes. No API changes.
Fixes
Literal.sourceandLiteral.writeno longer crash on a value holding a range. swift-format requires folded operators and calledfatalErroron0...3. Operators are folded first.- A string containing
"\r\n"renders. It is oneCharacter, so per-Characterescaping missed it and the render threw. Strings are escaped per Unicode scalar now. SwiftLiteralReflectionno longer links Testing and XCTest.DependenciesTestSupportwas a dependency of the engine target. An executable using it outside a test runner failed to launch withLibrary not loaded: @rpath/Testing.framework.- A
.swift-formatsource scoped withwithDependenciesapplies whole.CodeFormatterread the globalLiteralConfiginstead of the source the render was given.
Performance
p50, 0.4.0 → 0.4.1, same machine:
| Benchmark | Wall clock | Mallocs |
|---|---|---|
Literal.source, one order |
2.10 ms → 1.19 ms | 5,515 → 3,391 |
Literal.source, 1000 orders |
1.59 s → 0.76 s | 2.99M → 1.34M |
| Render 1000 orders | 141 ms → 84 ms | 476K → 248K |
| Render 2000 strings with escapes | 9.0 ms → 5.5 ms | 18K → 15K |
| Render an enum tree 40 deep | 944 µs → 405 µs | 4,621 → 1,885 |
Output is byte-identical. What paid off, and how to measure: docs/performance.md.