Tool Providing Easy To Understand Information On Objective-C Code Performance

A couple of days I mentioned a small library that allows you to easily time a section of objective-c code to help in optimizing performance.

Here’s an open source optimization tool/library that takes this to another level called Hookshot.

Hookshot allows you to time multiple sections of code using a whitelist, view a graph of thread activity on a running app, and count how many instances there are of a given class.

Using the Hookshot tool you can then filter and sort the data to more easily find what you’re after.

Here’s an example from the readme showing some data generated by Hookshot filtered with a regex:

$ bin/profile.py –message ‘.*did’
Using /Users/robbywalker/Library/Application Support/iPhone Simulator/6.0/Applications/C1FB13C1-C230-4435-8A10-F7BED5A6B475/Documents/profile-23274
message                                                                  calls     ownTime       avgOwn      maxOwn         total
AppDelegate.application:didFinishLaunchingWithOptions:                   1         7.913ms       7.9130ms    7.9130ms       25.179ms
UIWebView.webView:didFinishLoadForFrame:                                 1         3.458ms       3.4580ms    3.4580ms       3.473ms
UIWebView._didMoveFromWindow:toWindow:                                   1         0.212ms       0.2120ms    0.2120ms       0.261ms
UIWebView.nsis_valueOfVariable:didChangeInEngine:                        4         0.130ms       0.0325ms    0.0400ms       0.232ms
UIWebView.webView:resource:didFinishLoadingFromDataSource:               12        0.100ms       0.0083ms    0.0140ms       0.100ms
UIWebView.webView:didStartProvisionalLoadForFrame:                       1         0.062ms       0.0620ms    0.0620ms       0.587ms
UIWebView.view:didSetFrame:oldFrame:                                     2         0.056ms       0.0280ms    0.0370ms       2.029ms
UIWebView.webView:didFirstLayoutInFrame:                                 2         0.023ms       0.0115ms    0.0130ms       0.023ms
UIWebView.webView:didReceiveServerRedirectForProvisionalLoadForFrame:    1         0.018ms       0.0180ms    0.0180ms       0.026ms
UIWebView.webView:didClearWindowObject:forFrame:                         1         0.016ms       0.0160ms    0.0160ms       0.016ms
UIWebView.webView:didReceiveTitle:forFrame:                              1         0.015ms       0.0150ms    0.0150ms       0.015ms
UIWebView.webView:didCommitLoadForFrame:                                 1         0.010ms       0.0100ms    0.0100ms       0.010ms
UIWebView.didMoveToSuperview                                             1         0.004ms       0.0040ms    0.0040ms       0.004ms
UIWebView.didAddSubview:                                                 1         0.004ms       0.0040ms    0.0040ms       0.004ms
UIWebView.didMoveToWindow                                                1         0.003ms       0.0030ms    0.0030ms       0.003ms

You can find Hookshot by Cue on Github here.

A great tool for generating easy to interpret optimization data.

DeliciousTwitterFacebookRedditLinkedInEmail

Original article: Tool Providing Easy To Understand Information On Objective-C Code Performance

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *