singed icon indicating copy to clipboard operation
singed copied to clipboard

Add `start` and `stop` methods for when code isn't conveniently block wrappable

Open technicalpickles opened this issue 2 years ago • 4 comments

stackprof supports using start / stop in addition to the block usage. This is helpful for when things aren't cleanly block wrapped.

cc @baweaver who requested it

technicalpickles avatar Jan 23 '23 13:01 technicalpickles

This would help profiling Rails boot too

nate-at-gusto avatar Mar 06 '23 22:03 nate-at-gusto

@nate-at-gusto how are you thinking you'd use it in that case? I've been using the CLI to do this (with rbspy under the hood)

technicalpickles avatar Mar 07 '23 15:03 technicalpickles

Add Singed.start to boot.rb, bin/rails runner 'Singed.stop'

nate-at-gusto avatar Mar 07 '23 23:03 nate-at-gusto

I can see the value in this now. I have been using memory_profiler recently, and have used things like at_exit hooks to stop and generate the report. I could see doing the same with singed.

technicalpickles avatar Sep 07 '23 12:09 technicalpickles