about glibc performance

Konstantin Kharlamov hi-angel@yandex.ru
Mon Mar 25 09:37:00 GMT 2019



On Пн, Mar 25, 2019 at 10:37:11, Jimmie <zpjjimmie@163.com> wrote:
> 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.

Oops, looks like your email client doesn't handle plain text well. But 
nothing that a few Emacs regexps can't fix :)

Here're fixed benchmark results.

size     glibc          tcmalloc    tbbmalloc
1        213us          821us        168us
10       215            820          175
50       208            832          186
100      204            808          194
500      250            852          183
1000     428            859          180
5000     414            892          190
8128     389            880          194
8129     388            891          525
10000    392            838          554
100000   332            846          562
262144   321            852          546
262145   312            2045         600
1000000  312            2126         555
10000000 331            4645         1228


malloc and free in 4 threads, 5000 times per-thread
size     glibc         tcmalloc  tbbmalloc
1        284            1629    186
10       297            1093    143
48       285            1252    151
49       282            552     150
100      283            556     157
1000     322            510     168
5000     313            529     162
8128     312            528     173
8129     332            597     1350
10000    324            589     1425
100000   316            535     1428
262144   319            534     1524
262145   328            32596   1545
1000000  321            27106   1330
10000000 323            34590   14141

Well, looks like tcmalloc lags far behind the glibc, that's cool (well 
for us at least :).




More information about the Libc-help mailing list