Skip to content

Commit deb4df9

Browse files
comment
1 parent 2fd731f commit deb4df9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/cpp-statsd-client/StatsdClient.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ inline void StatsdClient::send(const std::string& key,
286286
std::stringstream valueStream;
287287
valueStream << std::fixed << std::setprecision(m_gaugePrecision) << value;
288288

289+
// the thread keeps this buffer around and reuses it, clear should be O(1)
290+
// and reserve should only have to do so the first time, after that, it's a no-op
289291
static thread_local std::string buffer;
290292
buffer.clear();
291293
buffer.reserve(256);

0 commit comments

Comments
 (0)