Hacker News new | ask | show | jobs
by drham 4415 days ago
Showing the CPU+Battery utilization graph for a sample app is a pretty dubious way to demonstrate the performance impacts of swizzling sendAction:to:from:forEvent:

It may indeed be a negligible impact as they claim, but using the Time Profiler instrument they could show exactly how much time is spent in the main queue on their swizzled code which would be a much better indication of whether or not the performance impact is negligible than eyeballing a cpu utilization graph.

1 comments

That's true. The reason we showed the Energy Usage graph is because that's our most common perf-related question ("How does this affect battery life?").

It's certainly worth displaying the time spent in the replacement method call using the Time Profiler.

I agree with the parent. The Time Profiler data is more important in my opinion than the Energy Usage for something like this. I worry about energy usage when hardware is involved (Core Location, networking in general, accelerometer) but ideally it would be nice to see both.
Agreed. Will keep in mind next time we display performance stats.

At the very least, it should be trivial to confirm that CPU usage is low by checking out this code (or installing Heap) and running Time Profiler yourself.