Reduce libstdc++-v3 locale::locale() lock contention

Jimmy Guo jguo@yahoo-inc.com
Thu Dec 17 20:12:00 GMT 2009


>> Yes you are right.  Cannot do this without ABI breakage.  The old object
>> handling destruction will cause problem.
>>   
> Yeah, I also think so, unfortunately :( Would improve the performance a
> lot, eh? Any idea how much?

Indeed a lot ... so tempted to apply this to my custom gcc and ask all of
our affected projects to rebuild their libraries ...

a. Current:
nthreads = 1: 1585
nthreads = 2: 4501
nthreads = 4: 26203
nthreads = 8: 31745

b. locale::locale() lock contention reduction:
nthreads = 1: 1237
nthreads = 2: 2028
nthreads = 4: 8371
nthreads = 8: 21262

c. 'b' + C locale ref counting removal:
nthreads = 1: 1159
nthreads = 2: 1523
nthreads = 4: 1742
nthreads = 8: 1902

- Jimmy



More information about the Libstdc++ mailing list