Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.19.0
-
None
-
None
Description
Currently, the `to_string()` overloads in `TToString.h` call the `std::locale` constructor for every single call. Creating locales is surprisingly expensive. We have an application where we - especially during tests - write large amounts of Thrift dumps to disk, and is this application we currently spend around 17% of total CPU time in std::locale's constructor (building with MSVC, in a Release build - other compilers might optimize this away?). With the proposed change (see GitHub), it's basically down to zero.
Since we always create the exact same locale anyways, using a `const static` one does not hurt.
Attachments
Issue Links
- links to