CL 163557 added a call to runtime.Callers in the path of errors.New, which has now become a bottleneck in cmd/go initialization (see #29382 (comment)).
While I understand the desire to capture stack information in errors (#29934), errors.New in particular used to be an inexpensive operation, and it needs to remain inexpensive. Ideally, errors.New(someConstant) should be fully inlined: the caller PC is known at link-time, and that's all we should need in order to produce a reasonable error frame.
CL 163557 added a call to
runtime.Callersin the path oferrors.New, which has now become a bottleneck incmd/goinitialization (see #29382 (comment)).While I understand the desire to capture stack information in errors (#29934),
errors.Newin particular used to be an inexpensive operation, and it needs to remain inexpensive. Ideally,errors.New(someConstant)should be fully inlined: the caller PC is known at link-time, and that's all we should need in order to produce a reasonable error frame.