Reputation: 1332
I would like to measure branch prediction fails on Xcode for Intel processors on Mac OS X, with the obvious intent of speed optimization.
Is there a way to program XCode's Instruments in order to achieve this?
I have already checked, and this information is unfortunately not present in Xcode documentation. I suspect this could be achieved with some custom setting.
The purpose is identifying optimization problems such as this one: Why is it faster to process a sorted array than an unsorted array?
I am aware that an Intel commercial solution exists, for Intel Processors running on Linux and Windows. On OS X you can apparently only monitor a remote Intel processor running on a Linux or Windows system.
Rather than a commercial tool, I would prefer a way to set/program Xcode and Apple tools to gain at least a minimum of visibility on this issue.
Upvotes: 2
Views: 1139
Reputation: 123570
For anyone else struggling with this, in Instruments 9.2:
Upvotes: 6
Reputation: 94375
There are hardware performance counters (PMC) in XCode's Instuments:
There are hidden by default branch events in Window > Manage PM Events
, according to
http://meandmark.com/blog/2011/10/event-profiler-and-counters-instruments/
Upvotes: 2