jtmalloc performance Vs ptmalloc

From: Channa <channa.kad_at_gmail.com>
Date: Wed, 10 Dec 2008 17:46:14 +0530
Hi,
I tried to execute the benchmark test malloc-test to compare the ptmalloc
performance and jemalloc performance. jemalloc seems to performance
better than ptmalloc under following conditions.

 - If memory requests are less than 3840Bytes jemalloc is faster than ptmalloc
Jemalloc:
# ./malloc-test 1024 10000000 5
Starting test with 5 threads...
 Thread -1086325424 adjusted timing: 0.893323 seconds for 10000000
requests of 1024 bytes.
 Thread -1090519728 adjusted timing: 0.893581 seconds for 10000000
requests of 1024 bytes.
 Thread -1082131120 adjusted timing: 0.983221 seconds for 10000000
requests of 1024 bytes.
 Thread -1088422576 adjusted timing: 1.346636 seconds for 10000000
requests of 1024 bytes.
 Thread -1084228272 adjusted timing: 1.394940 seconds for 10000000
requests of 1024 bytes.

Ptmalloc:
# ./malloc-test 1024 10000000 5
Starting test with 5 threads...
 Thread -1208353904 adjusted timing: 2.427992 seconds for 10000000
requests of 1024 bytes.
 Thread -1239823472 adjusted timing: 2.474918 seconds for 10000000
requests of 1024 bytes.
 Thread -1218843760 adjusted timing: 2.394854 seconds for 10000000
requests of 1024 bytes.
 Thread -1250313328 adjusted timing: 3.695654 seconds for 10000000
requests of 1024 bytes.
 Thread -1229333616 adjusted timing: 5.081604 seconds for 10000000
requests of 1024 bytes.

 - If memory requests are page aligned i.e large allocations jemalloc
is slower than ptmalloc.

jemalloc:

# ./malloc-test 9300 10000000 5
Starting test with 5 threads...
 Thread -1077936816 adjusted timing: 4.648531 seconds for 10000000
requests of 9300 bytes.
 Thread -1086325424 adjusted timing: 4.837230 seconds for 10000000
requests of 9300 bytes.
 Thread -1080033968 adjusted timing: 4.978933 seconds for 10000000
requests of 9300 bytes.
 Thread -1084228272 adjusted timing: 7.029323 seconds for 10000000
requests of 9300 bytes.
 Thread -1082131120 adjusted timing: 7.075402 seconds for 10000000
requests of 9300 bytes.

Ptmalloc:

# ./malloc-test_glib 9300 10000000 5
Starting test with 5 threads...
 Thread -1229083760 adjusted timing: 2.860437 seconds for 10000000
requests of 9300 bytes.
 Thread -1250063472 adjusted timing: 3.254859 seconds for 10000000
requests of 9300 bytes.
 Thread -1218593904 adjusted timing: 4.334052 seconds for 10000000
requests of 9300 bytes.
 Thread -1208104048 adjusted timing: 4.139268 seconds for 10000000
requests of 9300 bytes.
 Thread -1239573616 adjusted timing: 5.396595 seconds for 10000000
requests of 9300 bytes.

So jemalloc takes more time for Large allocations than ptmalloc.

For Huge allocations freater than 1MB again jemalloc is faster than ptmalloc.

i tested this on 4 CPU intel x86 machine.

Could you please tell me if there is any method to increase the
performance for Large allocations.?

I tried to increase the bins by setting the PAGE_SHIFT to 13 that time
the performance of jemalloc was better for allocations
till 7936.
As per my analysis using bins for all allocations less than 1MB
reduces the time taken but which may not be correct.
I am trying to modify the Large allocations to increase the
performance, Could you suggest some ideas.

Thanks in Advance,
Channa
Received on Wed Dec 10 2008 - 11:16:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:38 UTC