Re: fast bcopy...

From: Alex Dupre <ale_at_FreeBSD.org>
Date: Wed, 02 May 2012 23:05:51 +0200
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
Received on Wed May 02 2012 - 19:05:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:26 UTC