

Nitro: A Quick And Simple Profiler For Golang - spf13
http://spf13.com/project/nitro

======
AndreasFrom
What are the benefits over the built in pprof?

~~~
spf13
It's not at all a replacement. If you've used the built in pprof it's very
detailed. All trees if you will.

Nitro provides the forest. Using this along with pprof helps narrow down where
to focus your attention.

~~~
AndreasFrom
I've used it a bit and found top and -cum very useful. Nitro seems to combine
memory and CPU(?) but besides that I don't understand the benefit.

Edit: The author expanded here:
[https://news.ycombinator.com/item?id=6022679](https://news.ycombinator.com/item?id=6022679)

Nitro seems quite nice.

------
jzelinskie
Dave Cheney also just released a profiling wrapper, would you mind elaborating
on the differences?

~~~
spf13
Dave's and pprof are both similar in that they run the application and poll
randomly which routine the execution is currently in.

The output of pprof and Dave's (which uses pprof) would look like:

    
    
           2  13.3%  13.3%        2  13.3% go/scanner.(*Scanner).next
           2  13.3%  26.7%        2  13.3% path.Clean
           1   6.7%  33.3%        3  20.0% go/scanner.(*Scanner).Scan
           1   6.7%  40.0%        1   6.7% main.hasPathPrefix
           1   6.7%  46.7%        3  20.0% main.mountedFS.translate
           1   6.7%  53.3%        1   6.7% path.Dir
           1   6.7%  60.0%        1   6.7% path/filepath.(*lazybuf).append
           1   6.7%  66.7%        1   6.7% runtime.findfunc
           1   6.7%  73.3%        2  13.3% runtime.makeslice
           1   6.7%  80.0%        2  13.3% runtime.mallocgc
    

They are telling you what percent of the time the polling was in that routine.

Nitro is very different. You put breaks at major sections in your application
where you want to measure and label those breaks.

For instance if you wrote an application to take markdown files and convert
them to html you may split that up into 3 sections and see the following
output.

    
    
        import markdown files:
          4.664481ms (5.887625ms)         0.43 MB     4583 Allocs
        convert to html:
          65.196788ms (71.107809ms)      17.13 MB     70151 Allocs
        write html files:
          1.823434ms (72.960713ms)        0.12 MB     3720 Allocs
    

Hopefully the difference is clear. If you wanted to break it up further you
can.

Perhaps you don't find it usable, that's fine. It's not for you.

Personally I find this high level really valuable. When I make changes... say
tweaking a process or adding a new feature, it's great to see the difference
between execution times, memory use & allocations. Using pprof it is rather
hard to get that kind of information.

~~~
jzelinskie
Thanks!

