What kind of code microprofiling/benchmarking software do you guys use? I was wondering if anyone knew of any that can also be used as a separate tool (open source preferred but I dont mind proprietary) rather than already integrated into something like Visual Studio.

Edit: I would like it to support Windows and Linux. I mostly program in C right now, but expanding into other languages (e.g., Rust, Python)

  • entwine@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    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)

  • cecilkorik@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    8 months ago

    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.