mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <>
Subject Review Request 58288: Added stringify overload specialized for 'std::string'.
Date Mon, 10 Apr 2017 18:12:25 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for mesos and Neil Conway.

Repository: mesos


In our code base 'stringify' serves as an explicitly named conversion
function to 'string'. The default implementation invokes a type's
'operator<<' to serialize the object to 'string' via a 'stringstream'
which is not a cheap operation.

This patch adds a trivial overload of 'stringify' for 'string' which
directly returns its argument. This helps us avoid the overhead of the
default overload. Calls of 'stringify' with 'string' argument might
appear in generic code, e.g., currently when invoking 'stringify' on a
container of 'string's.


  3rdparty/stout/include/stout/stringify.hpp 698431583d2288d3c635211e651914316bfd3ee9 



`make check` (Fedora 25).

At `-O2` with clang-5 this saves about 90% when stringifying a `string`.


Benjamin Bannier

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message