-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 41131 |
| Resolution | FIXED |
| Resolved on | Mar 19, 2019 13:35 |
| Version | unspecified |
| OS | Windows NT |
| CC | @mclow |
Extended Description
On my win10 machine, the below program runs in 2.647s with libc++ and 0.357s with MSVC's STL. Most of the time is spent converting int to string:
snprintf_l() src/support/win32/locale_win32.cpp
std::num_put<>::do_put() include/locale:1461
std::num_put<>::put() include/locale:1279
std::basic_ostream<>::operator<<() include/ostream:462
main() main.cc:6
The problem appears to be that snprintf_l() makes 10 calls to setlocale() via __libcpp_locale_guard.
#include
int main() {
int x = 1234;
std::ostringstream os;
for (int i = 0; i < 100000; i++) {
os << x;
os.clear();
}
}
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.