-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.performance
Description
This is the same issue as #40476 but specifically for mingw. The prior issue was fixed for MSVC with https://reviews.llvm.org/D59525 and the follow-up https://reviews.llvm.org/D59727, but mingw still uses the slow path requiring __libcpp_locale_guard.
I don't have proper benchmark data now, but converting numbers to strings using std::ostringstream is apparently quite slow on mingw. Especially when the current locale is not "C", the setlocale call takes the majority of time (see image below). When the locale is already "C" it seems about a magnitude faster but setlocale is still quite significant in profiling data.
(This is the code in use.)
The toolchain we use is llvm-mingw 20220323 (LLVM 14.0.0).
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.performance
