This may not fall under the umbrella of micro profiling, but I’ve using the cli tool perf a lot lately in Linux. Pretty powerful tool for performance profiling that can do active monitoring as well as take snapshots. Not sure about windows compatibility, maybe with wsl?
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
There are a lot out there in C++ land, and I'm sure C has a lot too. You can't really go wrong with any if them tbh, just check if it has a lot of stars and go for it. I've used microprofile before and it served me well. You can view live data from an embedded webserver.
Perfetto is a powerful one from Google, but I've never used it.
Also, don't overlook gprof. That works via auto instrumentation done by the compiler, so it'll give you the most detailed look at performance with zero work from you (besides interpreting the sometimes massive amount of info)
I'll look into it! gprof seems promising.
If you want to do resource profiling, Visual Studio can do that out of the box.
For simple benchmarking, specifically for seeing how long certain calls take, I just just the Stopwatch class and ouput the result to a log entry. Assuming you're using C# that is.
I might be going the wrong direction of "micro" here but time is the very minimal, tiny, and traditional unix way.
For example:
$ time curl https://lemmy.ca/post/61453347 > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 175k 0 175k 0 0 525k 0 --:--:-- --:--:-- --:--:-- 526k
real 0m0.343s
user 0m0.030s
sys 0m0.016s
There are also a large number of other profiling outputs you can ask time to spit out by passing it the appropriate command line flags.
I'll look into using this in my workflow
For what platform?
Updated my post. Windows + Linux
hyperfine is pretty good for command line tools