Agent skill

iOS Performance

Standards for Instruments, Memory Management, and Optimization.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/performance-hoangnguyen0403-agent-skills-standar

Metadata

Additional technical details for this skill

labels
ios performance instruments leaks
triggers
{
    "files": [
        "**/*.swift"
    ],
    "keywords": [
        "Instruments",
        "Allocations",
        "Leaks",
        "dequeueReusableCell"
    ]
}

SKILL.md

iOS Performance Standards

Priority: P0

Implementation Guidelines

Diagnostic Tools

  • Instruments: Regularly use Allocations and Leaks to detect memory issues.
  • Time Profiler: Identify heavy CPU tasks and Main Thread stalls.
  • Network instrument: Analyze request payload sizes and frequency.

Optimization

  • Table/Collection Views: Always use dequeueReusableCell and keep cellForRowAt logic lightweight.
  • Image Caching: Use SDWebImage or Kingfisher for remote assets to prevent redundant fetching and main-thread decoding. (Note: AsyncImage lacks built-in caching; prioritize third-party for lists).
  • Background threads: Offload expensive work (parsing, encryption) from the Main thread using GCD or Tasks.

Diagnostics

  • Compiler Warnings: Enable SWIFT_TREAT_WARNINGS_AS_ERRORS in Release builds.
  • Static Analyzer: Use Xcode's "Analyze" (Product > Analyze) to find logic errors.

Anti-Patterns

  • CPU work on Main Thread: **No parsing/processing on Main**: Use background thread.
  • Force Cache Flushes: **No redundant cache clears**: Let the system handle low-memory warnings via AppDelegate.
  • Retain Cycles: **Check for cycles in Instruments**: Use the Leaks instrument frequently.

References

  • Profiling & Optimization

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results