SwiftLee Apr 20, 2026

Xcode Instruments Time Profiler: Improve performance with AI

Article Summary

Antoine van der Lee just achieved a 25x performance improvement using AI agents and Xcode Instruments. His workflow shows how AI can analyze profiling data and iterate on optimizations faster than manual debugging.

Van der Lee shares his process for using AI agents to optimize RocketSim's accessibility element fetching, which initially took over 12 seconds. By feeding Time Profiler data to AI agents through multiple optimization phases, he reduced execution time from 12 seconds to just 485ms.

Key Takeaways

Critical Insight

Combining Xcode Instruments Time Profiler output with AI agents can deliver 25x performance gains through systematic iteration and data driven optimization.

Van der Lee is building a new RocketSim CLI command that will automatically optimize profiling data format for AI consumption and token efficiency.

About This Article

Problem

RocketSim's accessibility element fetcher had two problems. It missed elements like Tab Bar items, and it was slow. Fetching screens with 70+ elements took 12.18 seconds, which made it impractical for agent-based simulator navigation.

Solution

Antoine van der Lee used Xcode Instruments Time Profiler and signpost instruments to give AI agents visual performance data. He then created prompts that combined signpost intervals with Time Profiler deep copies. This let the agents guide iterative optimization cycles.

Impact

Four optimization phases, guided by AI analysis of the profiling data, brought execution time down from 12.18 seconds to 485 milliseconds. That's a 25x improvement, and the code still works the same way.