malloc vs. tcmalloc
일반 malloc 을 사용할 경우
root@cnode01-m:~/example# ./a.out 1024 10000000 8
Starting test...
Thread 140329163872000 adjusted timing: 2.157629 seconds for 10000000 requests of 1024 bytes.
Thread 140329172264704 adjusted timing: 2.157310 seconds for 10000000 requests of 1024 bytes.
Thread 140329138693888 adjusted timing: 2.149972 seconds for 10000000 requests of 1024 bytes.
Thread 140329130301184 adjusted timing: 2.156961 seconds for 10000000 requests of 1024 bytes.
Thread 140329147086592 adjusted timing: 2.148378 seconds for 10000000 requests of 1024 bytes.
Thread 140329121908480 adjusted timing: 2.157975 seconds for 10000000 requests of 1024 bytes.
Thread 140329155479296 adjusted timing: 2.149619 seconds for 10000000 requests of 1024 bytes.
Thread 140329113515776 adjusted timing: 2.189489 seconds for 10000000 requests of 1024 bytes.
tcmalloc을 사용할 경우
root@cnode01-m:~/example# ./a.out 1024 10000000 8
Starting test...
Thread 139765333366528 adjusted timing: 1.134744 seconds for 10000000 requests of 1024 bytes.
Thread 139765358544640 adjusted timing: 1.132659 seconds for 10000000 requests of 1024 bytes.
Thread 139765350151936 adjusted timing: 1.131576 seconds for 10000000 requests of 1024 bytes.
Thread 139765316581120 adjusted timing: 1.126168 seconds for 10000000 requests of 1024 bytes.
Thread 139765324973824 adjusted timing: 1.125040 seconds for 10000000 requests of 1024 bytes.
Thread 139765366937344 adjusted timing: 1.149594 seconds for 10000000 requests of 1024 bytes.
Thread 139765308188416 adjusted timing: 1.120508 seconds for 10000000 requests of 1024 bytes.
Thread 139765341759232 adjusted timing: 1.149722 seconds for 10000000 requests of 1024 bytes.
Jemalloc 과 THP 를 사용시 버그
참조:
malloc performance test http://www.citi.umich.edu/projects/citi-netscape/reports/malloc.html
tcmalloc : http://goog-perftools.sourceforge.net/doc/tcmalloc.html
http://www.percona.com/blog/2012/07/05/impact-of-memory-allocators-on-mysql-performance/