aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2023-11-29 09:31:05 -0500
committerGitHub <noreply@github.com>2023-11-29 09:31:05 -0500
commit1a5af34e6fcb56098e67d3272e1e89a05528f15e (patch)
tree97c1cc173f969012985baff605b7f8d0137357d2 /flang/lib/Frontend/CompilerInvocation.cpp
parentfa712b0764d30e415159537d3e89c994cdef73f9 (diff)
downloadllvm-1a5af34e6fcb56098e67d3272e1e89a05528f15e.zip
llvm-1a5af34e6fcb56098e67d3272e1e89a05528f15e.tar.gz
llvm-1a5af34e6fcb56098e67d3272e1e89a05528f15e.tar.bz2
[libc++] Speed up classic locale (take 2) (#73533)
Locale objects use atomic reference counting, which may be very expensive in parallel applications. The classic locale is used by default by all streams and can be very contended. But it's never destroyed, so the reference counting is also completely pointless on the classic locale. Currently ~70% of time in the parallel stringstream benchmarks is spent in locale ctor/dtor. And the execution radically slows down with more threads. Avoid reference counting on the classic locale. With this change parallel benchmarks start to scale with threads. This is a re-application of f8afc53d641c (aka PR #72112) which was reverted in 4e0c48b907f1 because it broke the sanitizer builds due to an initialization order fiasco. This issue has now been fixed by ensuring that the locale is constinit'ed. Co-authored-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions