Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 May 2012 23:05:51 +0200
From:      Alex Dupre <ale@FreeBSD.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        current@freebsd.org, net@frebsd.org
Subject:   Re: fast bcopy...
Message-ID:  <4FA1A1AF.3050503@FreeBSD.org>
In-Reply-To: <20120502182557.GA93838@onelab2.iet.unipi.it>
References:  <20120502182557.GA93838@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FA1A1AF.3050503>