golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.93k stars 17.65k forks source link

x/net/trace: support lazy logging in EventLog #18320

Open RaduBerinde opened 7 years ago

RaduBerinde commented 7 years ago

Trace supports LazyLog/LazyPrintf which delays rendering of the event message until (and more importantly if) it is being displayed. This would be useful for EventLog as well, where large messages can cause noticeable slowdown.

I can work on the change if there is agreement on the new API. We can:

RaduBerinde commented 7 years ago

Any thoughts? I will work on the change, I just need some guidance wrt the options I mentioned.