From owner-freebsd-current@FreeBSD.ORG Wed May 13 08:27:21 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B25F22CB; Wed, 13 May 2015 08:27:21 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5481107; Wed, 13 May 2015 08:27:20 +0000 (UTC) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.1/8.15.1) with ESMTPSA id t4D8RBgn031684 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 May 2015 08:27:12 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Increase BUFSIZ to 8192 From: David Chisnall In-Reply-To: <20150513080342.GE37063@funkthat.com> Date: Wed, 13 May 2015 09:27:05 +0100 Cc: Poul-Henning Kamp , Baptiste Daroussin , current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20150511230635.GA46991@ivaldir.etoilebsd.net> <20150512032307.GP37063@funkthat.com> <14994.1431412293@critter.freebsd.dk> <20150513080342.GE37063@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2098) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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, 13 May 2015 08:27:21 -0000 On 13 May 2015, at 09:03, John-Mark Gurney wrote: >=20 > Poul-Henning Kamp wrote this message on Tue, May 12, 2015 at 06:31 = +0000: >> -------- >> In message <20150512032307.GP37063@funkthat.com>, John-Mark Gurney = writes: >>=20 >>> Also, you'd probably see even better performance by increasing the >>> size to 64k, [...] >>=20 >> easy: >> 8K on 32bit >> 64k on 64bit >=20 > Sounds good to me... Just for people who care... I did a quick set of > benchmarks on sha256.. This is using my preliminary patch to use sse4 > optimized sha256... But this should be the same for others... >=20 > The numbers in ministat output are the time in seconds it takes my > 3.4GHz AMD A10-5700 APU running HEAD to process a 512MB file, so lower > numbers are better.. I've processed them into easier to read format: > BUFSIZ: 145MB/sec > 8k: 193MB/sec > 16k: 198MB/sec > 64k: 202MB/sec > 128k: 202MB/sec > -t: 211MB/sec It looks like most of the benefit is gained at 16KB. Did you try = running the benchmark with something else running at the same time to = see if there is any advantage in trashing the caches a bit less (simple = case, what happens if you run two instances of the same benchmark at = once)? I suspect that you=E2=80=99re about right anyway - I recently did some = tests while playing with JavaScript FFI generation with a multithreaded = process JavaScript environment calling out to OpenSSL to do SHA = calculations and having each of 8 threads reading in 128KB chunks gave = the fastest performance (Core i7, 4 cores + hyperthreading), with only a = negligible gain over 64KB. In all cases, the JavaScript implementation = was significantly faster than the openssl tool, which used 8KB buffers. David