From owner-freebsd-current@FreeBSD.ORG Wed May 2 21:05:56 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F796106566B for ; Wed, 2 May 2012 21:05:56 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from lab.alexdupre.com (alexdupre-1-pt.tunnel.tserv23.zrh1.ipv6.he.net [IPv6:2001:470:25:450::2]) by mx1.freebsd.org (Postfix) with ESMTP id C179E8FC17 for ; Wed, 2 May 2012 21:05:55 +0000 (UTC) Received: (qmail 53017 invoked from network); 2 May 2012 21:05:54 -0000 Received: from atom.alexdupre.com (HELO ?192.168.178.12?) (sysadmin@alexdupre.com@192.168.178.12) by lab.alexdupre.com with ESMTPSA; 2 May 2012 21:05:54 -0000 Message-ID: <4FA1A1AF.3050503@FreeBSD.org> Date: Wed, 02 May 2012 23:05:51 +0200 From: Alex Dupre User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8 MIME-Version: 1.0 To: Luigi Rizzo References: <20120502182557.GA93838@onelab2.iet.unipi.it> In-Reply-To: <20120502182557.GA93838@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: current@freebsd.org, net@frebsd.org Subject: Re: fast bcopy... 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, 02 May 2012 21:05:56 -0000 Luigi Rizzo ha scritto: > For small blocks and multiples of 32-64 bytes, i noticed that > the following is a lot faster (breaking even at about 1 KBytes) > > static inline void > fast_bcopy(void *_src, void *_dst, int l) > { > uint64_t *src = _src; > uint64_t *dst = _dst; > for (; l> 0; l-=32) { > *dst++ = *src++; > *dst++ = *src++; > *dst++ = *src++; > *dst++ = *src++; > } > } DJB influence? :-) -- Alex Dupre