• A
    proc: do not load g0 until it's needed when stacktracing (#1863) · 5b4f4a81
    Alessandro Arzilli 提交于
    The stacktrace code occasionally needs the value of g.m.g0.sched.sp to
    switch stacks. Since this is only needed rarely and calling parseG is
    relatively expensive we should delay doing it until we know it will be
    needed.
    
    Benchmark before:
    
    BenchmarkConditionalBreakpoints-4              1        17326345671 ns/op
    
    Benchmark after:
    
    BenchmarkConditionalBreakpoints-4   	       1	15649407130 ns/op
    
    Reduces conditional breakpoint latency from 1.7ms to 1.56ms.
    
    Updates #1549
    5b4f4a81
stack.go 20.9 KB