From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 12:16:16 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AA1C1065673 for ; Wed, 10 Dec 2008 12:16:16 +0000 (UTC) (envelope-from channa.kad@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.188]) by mx1.freebsd.org (Postfix) with ESMTP id CA48A8FC1C for ; Wed, 10 Dec 2008 12:16:15 +0000 (UTC) (envelope-from channa.kad@gmail.com) Received: by rn-out-0910.google.com with SMTP id j71so489498rne.12 for ; Wed, 10 Dec 2008 04:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=m9NmKMvAcQFJ20BmVwxqIhs+6u4W0Aeya1ojXOfJpU8=; b=p1mChxZUtSOgjb4VA/Z/9RuT4+P2C5fNTihSZ4ScLNJHGw8p5eP/GRWdFvleSVt16C q843G3+qPq3Y4qhBfYk3eeQ81Gvj3gCph18ktcZu/RABmcBX8/0CzsQnRADQ/7ua+Q4j qArI1vHARV7DvLpo8qFiLS0ug4PNaYUnl0rBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=Vht1N+3uTXzQh5n8SvhfCV243mM2l0Ah5iKoztkv4d46avAYrY3Hv0lSiZWrcIXzmk ArjhWTNbqJeoXkVUaN0NiJdBJxmEbC6VIenSBcHn0NWaKXdFKEDEVdeN+IpuzG9DMFwh P4pYbaAlNjp2wlDhENJIttKzhVN+mrJ1yeLBM= Received: by 10.64.250.7 with SMTP id x7mr1030593qbh.94.1228911374365; Wed, 10 Dec 2008 04:16:14 -0800 (PST) Received: by 10.64.156.4 with HTTP; Wed, 10 Dec 2008 04:16:14 -0800 (PST) Message-ID: <515c64960812100416x306eacbdic3872bc8bc2244b7@mail.gmail.com> Date: Wed, 10 Dec 2008 17:46:14 +0530 From: Channa To: "Jason Evans" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: freebsd-current@freebsd.org Subject: jtmalloc performance Vs ptmalloc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 12:16:16 -0000 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