cmd/compile: postpone argument conversions after inlining #20087
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
Look at this code:
If the code is compiled with
-gcflags=-l=4
,Log.Print()
is inlined intomain()
. Unfortunately, this does not get rid of the expensive argument conversions to empty interfaces.I know some work has been merged to speed up conversions of common data to empty interfaces, and that's great for when you are actually logging; but if logging is disabled, you can't fully get rid of the overhead.
I have a real high-performance program where I selectively enable logging for debugging reasons. Unfortunately, even with logging disabled, the overhead is measurable so I'm forced to actually comment out logging lines.
If the above pattern was optimized correctly, I could reword the API of my high-perf logging library to make sure such an optimization triggers for me.
The text was updated successfully, but these errors were encountered: