Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.05 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.05 KB

gbn

Greenlet BottleNeck profiler.
Measures time precisely using "greenlet.settrace" to pause/continue counting time on switch from/to original greenlet.
May count wall-clock time too. Also counts step calls and context switches.

Usage:

gbn_attach()

gbn('step1')
step1()

gbn('step2')
step2()

wall = gbn('step3')
step3()

wall = gbn('step4', wall=wall)
step4()

gbn('step5', wall=wall)
step5()

gbn()
does_not_count_this()

log.info(gbn_report_and_reset())
# OR
spawn(gbn_report_and_reset, each=60, log=log.info)

See help(gbn) for detailed docs.

Additional tools:

  • gxray - Heavy profiler when you don't know where to profile.
  • gswitched - Checks if greenlet switched.

gbn version 0.4.3
Copyright (C) 2016-2017 by Denis Ryzhkov denisr@denisr.com
MIT License, see http://opensource.org/licenses/MIT