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

There's a bunch of really good C++ profilers already. My current favourite is Tracy: https://github.com/wolfpld/tracy



Not if you are on macOS, the number of available profilers drops after every release. Same with leak detectors, valgrind doesnt work, sanitizers don't work anymore (even if you compile your own clang).


It took Apple a long time to bring ASan and TSan to macOS, but they work now, for me at least. (MSan still unavailable though).


At least in the specific case of Tracy, you can profile over the network. So, you instrument your OSX application, and it streams its data in realtime to your profiler viewer.

Though it's true that more advanced features require OS support (eg: showing how threads get moved amongst CPU cores, and so on).


Is there _any_ usable profiler on macOS? I've found Instruments to be straight-up useless (very slow, frequently gives just plain wrong results on larger projects) and pretty much every search I've tried just gives “use Instruments”.


Can't go wrong with spindump and sample.


Both address sanitizer and UB sanitizer work for me (macOS-13.6, Intel). You have to add a library search path and the appropriate `libclang_rt.*` library to your build.

Library search path is `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/1[4-9].[0-9].[0-9]/lib/darwin`.


Apple mostly keeps their sanitizers up-to-date? Not that it’s really a profiler, to be honest.


Sanitizers only sometimes work on Windows too :)


I found that you can use the 'leaks' command to replace vlgrind memcheck


samply is pretty sweet. It's been my go-to for Deno work for the last year or so.


Tracy and Superluminal.


Superluminal is great as well. I currently prefer Tracy because it gives faster profiling feedback.


Superluminal is windows (and xbox/playstation) only too, so it's off the board immediately.


Sadly there’s no one tool to rule them all. The only choice is to use the best tool for each platform.

Superluminal is far and away the best profiler imho.

Tracy is a great instrumented profiler. But damn do I love a good sampling profiler. Tracy can sample. But I had serious issues with it on one of my projects I could never get around.


I agree, just that I haven't used nor developed for Windows for quite some time, so can't use it. For games it's a natural environment, of course.




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

Search: