fast bcopy...

Alex Dupre ale at FreeBSD.org
Wed May 2 21:05:56 UTC 2012


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


More information about the freebsd-current mailing list