From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 12 00:41:27 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345A51065675 for ; Sat, 12 Nov 2011 00:41:27 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-qw0-f47.google.com (mail-qw0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id E1DE48FC0A for ; Sat, 12 Nov 2011 00:41:26 +0000 (UTC) Received: by qabj40 with SMTP id j40so4756894qab.13 for ; Fri, 11 Nov 2011 16:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S7j3LQQRzDBratwkDolJd25tb0QSTlu/rfL7eiO13UI=; b=tPmOKZ5J9m/xWBp9DOtXHlDTwptsSIdEPaWQNYrqnpeTOmAq6W30QYMmBaImBV8G0x bl95d+z1+UEa6hBiyNN3YdUwsXZjL7dD8iBvO8Eok5tt/8bnKfyZzBsXnHRUBiM45av0 /h4CJY0dQzAymDCvVduMPKfAAGmuTZp4pEh+0= MIME-Version: 1.0 Received: by 10.224.182.196 with SMTP id cd4mr10501593qab.3.1321056978601; Fri, 11 Nov 2011 16:16:18 -0800 (PST) Received: by 10.224.73.195 with HTTP; Fri, 11 Nov 2011 16:16:18 -0800 (PST) In-Reply-To: References: <4EAA8B4B.2090002@masterhost.ru> Date: Fri, 11 Nov 2011 19:16:18 -0500 Message-ID: From: Mehmet Erol Sanliturk To: Eitan Adler Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Daniil Cherednik , hackers@freebsd.org Subject: Re: performance of fork() syscalls X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 00:41:27 -0000 On Fri, Nov 11, 2011 at 6:09 PM, Eitan Adler wrote: > Sorry for the delayed reply. > > On Fri, Oct 28, 2011 at 7:00 AM, Daniil Cherednik > wrote: > > Hello. > > I have some questions about performance fork syscall. > > Great! > > > Result in FreeBSD (8.2, amd62): > > > > real 0m2.010s > > user 0m0.053s > > sys 0m1.946s > > > > Result in Linux (2.6.32-5-amd64): > > > > real 0m1.210s > > user 0m0.008s > > sys 0m1.200s > > > > > Does this mean performance of fork() in Linux is better? > No. It may be true that Linux's fork is faster than ours, but these > numbers don't show that. > > >From my own (albeit limited) knowledge the numbers you gave above are > statistically meaningless. You have one iteration of the sum of using > time(1) on one machine 10000 times. > This data can only provide the average of a single test case with many > possible causes for the slowness. > > Additionally, time(1) includes time spent in system calls, running > other programs, processing interrupts, etc. "sys" is a lie, as not > every context switch is tracked for performance reasons. Use > getrusage() instead. > > In order to have a meaningful comparison you would need to > a) Run the results under the Student's T test to see if there is a > significant different at p=95%. > b) Do the benchmarks on a machine running nearly nothing else. Run > your tests on Single User Mode, disable all services, remove the > computer from the network, mount the disks read-only, etc. Without > doing this there is too much noise, and it isn't possible to determine > what is causing the slow down (if there is any difference at all, see > part a) > > I understand that the numbers look bad, and that this is a lot of work > to do to see if there is a difference, but benchmarking is a > non-trivial exercise :) > > If I'm wrong here, please correct me. I am always open to learning new > things. > > > > And can you explain why? > > See above ;) > > > -- > Eitan Adler > You may design an experiment like that : Take more than 15 FreeBSD ( the same operating system ) running computers with the same window manager . The computers need not to be similar . Take at least 60 ( to obtain a good Normal distribution approximation with respect to Central Limit Theorem ) Linux computers ( the same kernel , but different Linux distributions ) . Apply the same fork statement and measure the execution time . Apply the Student t test to check equality of means after applying a test of equality of variances . If the fork time means are different statistically , smaller mean fork time is better than the other ( FreeBSD versus Linux ) . If the variances are different , the systems are different . Smaller variance is better than the other . The computers need not to be similar . Thank you very much Mehmet Erol Sanliturk