about glibc performance

Jimmie zpjjimmie@163.com
Mon Mar 25 07:41:00 GMT 2019


It seems like that I can't send attachment to libc-help. so I simply describe my test results.<br/>malloc and free 10000 times in per-thread, the datas is below(left column represent memsize per malloc. and the other column represent the cost time it uses, )<br/>                  glibc	tcmalloc	tbbmalloc<br/>1	            213us	          821us	168us<br/>10	            215	          820	175<br/>50	            208	          832	186<br/>100	            204	         808	        194<br/>500	            250	         852	        183<br/>1000	    428	         859	        180<br/>5000	    414	         892	        190<br/>8128	    389	         880	        194<br/>8129	    388	         891	        525<br/>10000	    392	         838	        554<br/>100000	    332	         846	        562<br/>262144	    321	         852	        546<br/>262145	     312	         2045	600<br/>1000000	     312	         2126	555<br/>10000000     331	        4645	1228<br/><br/><br/>malloc and free in 4 threads, 5000 times per-thread<br/> 	         glibc	tcmalloc	tbbmalloc<br/>1	            284	        1629	186<br/>10	            297	        1093	143<br/>48	            285	        1252	151<br/>49	            282	        552	        150<br/>100	            283	        556	        157<br/>1000	    322	        510 	        168<br/>5000	    313	        529	        162<br/>8128	    312	        528	        173<br/>8129	    332	        597	        1350<br/>10000	    324	        589	        1425<br/>100000	    316	        535	        1428<br/>262144	    319	        534	        1524<br/>262145	    328	        32596	1545<br/>1000000	    321	        27106	1330<br/>10000000    323	        34590	14141<br/><br/>and I can provide my test code if necessary.<br/><br/>for more convenient and effective, maybe you can use the benchmark from here, https://github.com/gperftools/gperftools/tree/master/benchmark.
At 2019-03-22 21:55:47, "Siddhesh Poyarekar" <siddhesh.poyarekar@gmail.com> wrote:
>On Fri, 22 Mar 2019 at 09:08, Carlos O'Donell <codonell@redhat.com> wrote:
>>
>> On 3/21/19 11:20 PM, Jimmie wrote:
>> > Hi, For serveral days, I did some test  about the memory performance
>> > of glibc(2.17) and tcmalloc(gperformance 2.7), and my test results
>> > indicate that glibc is more efficient then tcmalloc. generally,
>> > people think tcmalloc is efficient than glibc 2.3, but I use glibc
>> > 2.17, so I wonder if glibc 2.17 did some improvement on memory
>> > performance. looking forward to your reply, thank you.
>>
>> There were no changes in 2.17 which improved malloc performance.
>
>Actually, there were performance improvements to malloc between 2.3
>and 2.17, primarily the per-thread allocator that greatly reduced
>contention for multi-threaded applications.  I've argued in the past
>that the per-thread allocator should bring performance of a number of
>applications on par if not better than tcmalloc/jemalloc, but I never
>did a formal run and so never wrote a formal rebuttal of the tcmalloc
>claims.  If you've done formal tests, please do publish them!
>
>Siddhesh
>-- 
>https://siddhesh.in


More information about the Libc-help mailing list