Closed dotnwat closed 1 month ago
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/55063#019225e8-8793-49f6-a2c6-0f035deb28f4
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/55063#019225e3-165e-4346-8c38-423b2a9fbd46
Change looks fine, but it's a little concerning that there's suddenly a (seemingly unnecessary) copy happening here...and that it was detectable only because the struct in question has a deleted copy constructor.
do we have any way to detect similar cases for copyable structs? should we be using a different
fmt
API inside logger?
I don't think it was being copied before--the copy constructors are deleted. I think for some reason it's not able to convert into string_view in fmt9 like before, and it's trying some backup code path.
@BenPope would still appreciate a look at this when you get a chance.
I don't think it was being copied before
Ya, that's clear. I'm wondering whether there could be other (copyable) structs quietly taking a copy-incurring backup path in fmt9. The intermediate string_view seems kind of unusual anyway, so maybe it's a non-issue.
@BenPope would still appreciate a look at this when you get a chance.
Looks good to me.
I don't think it was being copied before
Ya, that's clear. I'm wondering whether there could be other (copyable) structs quietly taking a copy-incurring backup path in fmt9. The intermediate string_view seems kind of unusual anyway, so maybe it's a non-issue.
ahh, i see. yeh i dunno. it's one reason why we tend to delete copy constructors on most types so copies will be caught.
It seems that in fmt v8 either a copy of gss::buffer wasn't being made, or the explicit conversion operator to std::string_view was being made prior to a copy of the fmt argument.
Now in fmt v9 it looks like fmt is trying to make a copy before any conversion. So this PR just invokves the conversion up front and passes a std::string_view down into fmt.
Backports Required
Release Notes