Hacker News new | past | comments | ask | show | jobs | submit login

MacOS Instruments is really quite good.

I have a `profile` function I use.

    fn profile() {
        xcrun xctrace record --template 'Time Profiler' --launch -- $@
    }
Then I just do:

    $ profile ./my-binary -a -b -c "foo bar"
or w/e and when it completes (can be one-time run or long-running / interactive) now I have a great native experience exploring the profile.

All the normal bells and whistles are there and I can double click on something and see it inline in the source code with per-line (cumulative) timings.






> MacOS Instruments is really quite good.

It really isn't. It's probably the slowest profiler UI I've ever used (it loves to beachball…), it hardly has any hardware performance counters, and its actual profiling core (xctrace) is… just really buggy? After the fifth time where it told me “this function uses 5% CPU” and you optimize it away and absolutely nothing happened, because it was just another Instruments mirage. Or the time where it told me opening a file on iOS took 1000+ ms, but that was just because its end timestamps were pure fabrications.

Maybe it's better if you have toy examples, but for large applications, it's among the worst profilers I've ever seen along almost every axis. I'll give you that gprof is worse, though…




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: