]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/async/ProtocolV2: pass `desc` as `std::string_view` to write() 60106/head
authorMax Kellermann <max.kellermann@ionos.com>
Thu, 3 Oct 2024 15:21:23 +0000 (17:21 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Mon, 7 Oct 2024 20:43:30 +0000 (22:43 +0200)
commit966920e063cc1fa276fbc09798779d71be51947d
treed00f8d630ea3a7f4b64092dd02dbced2f92fdab5
parent7e5ebb79347518a54c2a76280a0a9fbd2a4d7a9b
msg/async/ProtocolV2: pass `desc` as `std::string_view` to write()

All callers really pass a C string literal, and declaring a
`std::string` parameter will implicitly create two `std::string`
instances: one on the caller's stack, and another one inside write()
as parameter to the continuation lambda.  This causes considerable and
unnecessary overhead.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/msg/async/ProtocolV2.cc
src/msg/async/ProtocolV2.h