• Dmitry Vyukov's avatar
    runtime: speed up StartTrace with lots of blocked goroutines · 747a158e
    Dmitry Vyukov authored
    In StartTrace we emit EvGoCreate for all existing goroutines.
    This includes stack unwind to obtain current stack.
    Real Go programs can contain hundreds of thousands of blocked goroutines.
    For such programs StartTrace can take up to a second (few ms per goroutine).
    
    Obtain current stack ID once and use it for all EvGoCreate events.
    
    This speeds up StartTrace with 10K blocked goroutines from 20ms to 4 ms
    (win for StartTrace called from net/http/pprof hander will be bigger
    as stack is deeper).
    
    Change-Id: I9e5ff9468331a840f8fdcdd56c5018c2cfde61fc
    Reviewed-on: https://go-review.googlesource.com/25573
    Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarHyang-Ah Hana Kim <hyangah@gmail.com>
    747a158e
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...