From owner-freebsd-threads@FreeBSD.ORG Sun Oct 7 16:38:13 2007 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C687016A418; Sun, 7 Oct 2007 16:38:13 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from rusty.kulnet.kuleuven.ac.be (rusty.kulnet.kuleuven.ac.be [134.58.240.42]) by mx1.freebsd.org (Postfix) with ESMTP id 832C313C459; Sun, 7 Oct 2007 16:38:13 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from localhost (localhost [127.0.0.1]) by rusty.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 075341D7BFA; Sun, 7 Oct 2007 18:05:42 +0200 (CEST) Received: from smtps01.kuleuven.be (smtpshost01.kulnet.kuleuven.be [134.58.240.74]) by rusty.kulnet.kuleuven.ac.be (Postfix) with ESMTP id D43B71D7BBA; Sun, 7 Oct 2007 18:05:40 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps01.kuleuven.be (Postfix) with ESMTP id 95F9B31E702; Sun, 7 Oct 2007 18:05:40 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.1/8.14.1) with ESMTP id l97G5esn005175; Sun, 7 Oct 2007 18:05:40 +0200 (CEST) (envelope-from tijl@ulyssis.org) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Tijl Coosemans To: Ivan Voras Date: Sun, 7 Oct 2007 18:05:38 +0200 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710071805.39399.tijl@ulyssis.org> X-Virus-Scanned: by KULeuven Antivirus Cluster Cc: freebsd-threads@freebsd.org Subject: Re: Unexpected threading performance result X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2007 16:38:13 -0000 On Sunday 07 October 2007 16:52:03 Ivan Voras wrote: > For an unrelated purpose, I'm benchmarking performance of tree > algorithms in SMP environments and my preliminary run has an unexpected > result. Here's the typical output from the (small) benchmark program, > run on a dual-core Athlon64 (i386 mode): > > Running benchmarks on small_nonuniform, 1000000 samples > Step 1: Running 100 loops > ** Step 1 benchmark completed 100 loops in 84.44 seconds. > Step 2: Running 2 threads with 100 loops each > ** Step 2 benchmark completed 100 loops in 2 threads in 167.46 seconds. My guess is, that in the beginning of step1() and step2() you have to add a line "time_start = gettime();".