Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - jemalloc: Page 1 of 11 (11 Items)
   
jemalloc  
I have ported FreeBSD's jemalloc to QNX.
So far on SMP it performs better than our stock malloc in libc with my test case but on UP it is worse than our stock 
one. I still have something to turn on to optimize.
 
I wrote a small program testm to test malloc and free, it will create 
threads as command line indicated if no arg then it will run with single 
thread(main).
 
our stock one:
# time ./testm
    0.10s real     0.10s user     0.00s system
# time ./testm 2
    0.76s real     0.14s user     0.41s system
# time ./testm 3
    7.91s real     0.33s user     3.72s system
# time ./testm 4
    6.11s real     0.31s user     5.96s system
# pidin in
CPU:X86 Release:6.3.2  FreeMem:1641Mb/2047Mb BootTime:Mar 11 10:48:32 
EST 2008
Processor1: 686 Intel 686 F6M14S4 1834MHz FPU
Processor2: 686 Intel 686 F6M14S4 1833MHz FPU
Processor3: 686 Intel 686 F6M14S4 1837MHz FPU
Processor4: 686 Intel 686 F6M14S4 1834MHz FPU
 
jemalloc:
# time ./testm 2
    0.48s real     0.69s user     0.15s system
# time ./testm 3
    0.77s real     1.00s user     0.83s system
# time ./testm 4
    0.99s real     1.39s user     1.65s system
# time ./testm 5
    1.34s real     1.74s user     2.80s system
# time ./testm 6
    1.56s real     2.13s user     3.31s system
# time ./testm   
    0.27s real     0.27s user     0.00s system
 
so from this case jemalloc's performance is better on SMP and seems that most malloc lib doesn't act well with SMP.
(google the firefox' comparision with others like glibc's malloc, google's ?malloc...)
 
I will see whether I can port some test cases to QNX as well.
Attachment: Text libjemalloc.so 79.11 KB