A workflow for using Xcode Instruments' Time Profiler in combination with AI agents to iteratively optimize iOS app performance. Using a real-world case study, accessibility element fetching was improved 25x (from ~12 seconds to ~485ms) across four optimization phases. The approach involves running the Time Profiler, copying signpost intervals and call tree data, then feeding that output as a structured prompt to an AI agent to plan the next round of improvements. Tips include adding a CLI to your app for isolated benchmarking, using Call Tree filters to reduce noise, and managing token usage by trimming profiler output. A dedicated RocketSim CLI command for automated performance tracing is also in development.

7m read timeFrom avanderlee.com
Post cover image
Table of contents
Sample Case: 25x faster accessibility elements fetchingAdding a CLI to your appUsing Xcode Instruments with AgentsIterate and improve

Sort: