/ go Public
errors: performance regression in New #30468
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
CL 163557 added a call to
runtime.Callersin the path of
errors.New, which has now become a bottleneck in
cmd/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.
The text was updated successfully, but these errors were encountered: