This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3] Make fprintf() function to multithread-safe
- From: Peng Haitao <penght at cn dot fujitsu dot com>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 01 Aug 2012 09:42:18 +0800
- Subject: Re: [PATCH v3] Make fprintf() function to multithread-safe
- References: <1340257789-14975-1-git-send-email-penght@cn.fujitsu.com> <CADZpyizABs-q_FC+KurnsxPKq4dW=AVTefc0EEwBFh6=E6T5dw@mail.gmail.com> <500E5094.2080203@cn.fujitsu.com> <1373925.OECUC7VnHD@byrd>
Hi, Andreas
On 07/24/2012 10:05 PM, Andreas Jaeger wrote:
> On Tuesday, July 24, 2012 15:36:52 Peng Haitao wrote:
>> [...]
>>> Performance counter stats for './fprintf':
>>
>> 30,029,273,153 instructions # 0.00 insns per
>> cycle
>>
>> 7.533755240 seconds time elapsed
>> [...]
>> # perf stat -e instructions -- ./fprintf_new > /dev/null
>>
>> Performance counter stats for './fprintf_new':
>>
>> 39,694,838,263 instructions # 0.00 insns per
>> cycle
>>
>> 9.690116102 seconds time elapsed
>
> So, the overhead is in this case 25 per cent? That's a lot IMO.
>
The overhead is big because the libc's version is different.
The ./fprintf with libc's version is glibc-2.12-1.80.el6.x86_64
The ./fprintf_new with libc's version is glibc-2.16-ports-merge-23-gc1d0079
The test results with same libc's version have been sent to the mail list,
please check, Thanks.
--
Best Regards,
Peng