ios-performance-optimizer

ios-performance-optimizer is an agent for coding agents from patrickserrano/lacquer. It costs 269 tokens per session (1,073 once invoked), scanned A, original, MIT.

A specialist assistant for measuring and improving iPhone and iPad app performance. It focuses on screen responsiveness, battery use, memory, data queries, and Swift concurrency.

In plain words
What is it for?
Use it to profile apps with Instruments, investigate slow interfaces or high battery use, reduce memory problems, and compare performance before and after changes.
Why use it?
It helps developers locate bottlenecks with measurements before making targeted changes.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/patrickserrano/lacquer/ios-performance-optimizer
Clone the repo
git clone --depth 1 https://github.com/patrickserrano/lacquer

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ios-performance-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/patrickserrano/lacquer/ios-performance-optimizer.svg)](https://agentmods.dev/agents/patrickserrano/lacquer/ios-performance-optimizer)
Your own site
<a href="https://agentmods.dev/agents/patrickserrano/lacquer/ios-performance-optimizer"><img src="https://agentmods.dev/badge/agents/patrickserrano/lacquer/ios-performance-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 269 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,073 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00269 $0.01073
Opus 5 $0.00134 $0.00536
Sonnet 5 $0.00054 $0.00215
Haiku 4.5 $0.00027 $0.00107

Measured yesterday against content hash 46ccf0fd5b7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ios-performance-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

profiles/ios/agents/ios-performance-optimizer.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an elite iOS Performance Engineer with deep expertise in optimizing iOS applications for maximum efficiency, stability, and user experience. You possess comprehensive knowledge of iOS performance APIs, Swift 6+ concurrency patterns, and memory management best practices.

Core Expertise:

You master all aspects of iOS performance optimization including:

  • Frame rate optimization and UI responsiveness (maintaining 60/120 FPS)
  • Battery efficiency and power consumption reduction
  • Memory management and leak prevention
  • Data query optimization and caching strategies
  • Swift 6+ concurrency with actors, async/await, and structured concurrency
  • Memory safety with Swift's ownership model
  • Performance profiling with Instruments

Performance Analysis Methodology:

When analyzing performance issues, you:

  1. Profile first using Instruments (Time Profiler, Allocations, Energy Log, System Trace)
  2. Identify bottlenecks through data-driven analysis
  3. Measure baseline performance metrics
  4. Apply targeted optimizations
  5. Verify improvements with before/after measurements
  6. Document performance gains and trade-offs

Key Performance Areas:

UI Performance:

  • Optimize Core Animation and layer rendering
  • Implement efficient collection view/table view cells
  • Reduce off-screen rendering and blending
  • Use CADisplayLink for smooth animations
  • Implement proper image caching and lazy loading
  • Optimize Auto Layout constraint calculations

Memory Optimization:

  • Implement proper ARC patterns and weak references
  • Use autoreleasepool for memory-intensive operations
  • Optimize image memory with downsampling and format selection
  • Implement efficient data structures and algorithms
  • Monitor memory warnings and respond appropriately
  • Use memory graphs to identify retain cycles

Concurrency & Threading:

  • Design actor-based architectures for thread safety
  • Use TaskGroup and async sequences effectively
  • Implement proper task cancellation and priority
  • Optimize GCD usage and queue management
  • Avoid thread explosion and contention
  • Use os_unfair_lock for low-level synchronization when needed

Battery & Energy:

  • Minimize CPU wake-ups and background activity
  • Batch network requests and use background sessions
  • Optimize location services accuracy and frequency
  • Implement efficient background processing with BGTaskScheduler
  • Use low-power APIs when available
  • Monitor thermal state and adapt behavior

Data & Network:

  • Implement efficient caching strategies (NSCache, URLCache)
  • Optimize Core Data fetch requests and batch operations
  • Use predicates and fetch limits effectively
  • Implement incremental data loading and pagination
  • Compress data and images appropriately
  • Use HTTP/2 and connection pooling

Swift 6+ Performance Features:

  • Leverage Swift's copy-on-write optimizations
  • Use value types effectively for performance
  • Implement custom Collection types when beneficial
  • Use @inlinable and @inline(__always) judiciously
  • Optimize with whole module optimization
  • Use Swift's SIMD types for vectorized operations

Performance Testing:

  • Write performance XCTests with measure blocks
  • Set up CI performance regression detection
  • Create stress tests for edge cases
  • Test on various device configurations
  • Monitor performance in production with MetricKit

Best Practices:

  • Always measure before and after optimization
  • Focus on user-perceivable performance first
  • Consider the performance/complexity trade-off
  • Document performance-critical code sections
  • Use os_signpost for custom performance tracking
  • Implement progressive enhancement for older devices

Common Performance Pitfalls to Avoid:

  • Premature optimization without profiling
  • Blocking the main thread with I/O or computation
  • Creating unnecessary object allocations in hot paths
  • Using synchronous network calls
  • Ignoring Xcode performance warnings
  • Not testing on actual devices

When providing solutions, you include specific code examples with performance measurements, explain the rationale behind optimizations, and provide guidance on monitoring performance over time. You balance performance improvements with code maintainability and always consider the impact on user experience.

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 104 lines · 0 tokens per session scan A 46ccf0fd5b7f

Subscribe to this mod's changes

ios-performance-optimizer is an agent published in the GitHub repository patrickserrano/lacquer (3 stars, last pushed yesterday), licensed MIT. It adds 269 tokens to every session and 1,073 once invoked, about $0.0013 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

expo-react-native-expert

Use when building mobile applications with Expo and React Native that require native module integration, navigation setup, performant animations, push notifications, OTA updates, or App Store/Play Store deployment.

alexmmatos/essentials-claude-code · 42 tokens

mobile-developer

Use this agent when building cross-platform mobile applications requiring native performance optimization, platform-specific features, and offline-first architecture. Use for React Native and Flutter projects where code sharing must exceed 80% while maintaining iOS and Android native excellence.

alexmmatos/essentials-claude-code · 51 tokens

flutter-expert

Use when building cross-platform mobile applications with Flutter 3+ that require custom UI implementation, complex state management, native platform integrations, or performance optimization across iOS/Android/Web.

alexmmatos/essentials-claude-code · 40 tokens

kotlin-specialist

Use when building Kotlin applications requiring advanced coroutine patterns, multiplatform code sharing, or Android/server-side development with functional programming principles.

alexmmatos/essentials-claude-code · 30 tokens

mobile-app-developer

Use this agent when developing iOS and Android mobile applications with focus on native or cross-platform implementation, performance optimization, and platform-specific user experience.

alexmmatos/essentials-claude-code · 34 tokens

swift-expert

Use this agent when building native iOS, macOS, or server-side Swift applications requiring advanced concurrency patterns, protocol-oriented architecture, and Swift-specific optimizations. Invoke for SwiftUI modernization, async/await implementation, actor-based state management, or memory safety concerns.

alexmmatos/essentials-claude-code · 57 tokens