audit-swift-performance
Scan for performance anti-patterns at the Swift language level — overhead from ARC, unnecessary allocations, and code that prevents the optimizer from specializing generics.
What This Command Does
Launches the swift-performance-analyzer agent to surface Swift-language performance issues that show up in Time Profiler and Allocations traces.
What It Checks
- ARC issues — excessive retain/release in hot paths,
@inlinableopportunities, missingconsume/borrowownership - Allocation patterns —
Array.appendin tight loops withoutreserveCapacity, repeatedStringconcatenation, unnecessary boxing - Generic specialization — public generics without
@inlinablethat compile to slow witness-table dispatch - Existential overhead —
any Protocolparameters wheresome Protocolwould specialize - COW pitfalls — copy-on-write types being mutated through multiple references, defeating value semantics
Related Agent
- swift-performance-analyzer — The agent that powers this command