Here's a review to optimize several byte swapping macros in sys/byteorder.h
http://dan.drydog.com/reviews/6729208-bswap3/

I optimized the macros by calling the htons()/htonl()/htonll() builtin 
function, or with a simple unaligned assignment (x86), or (for BSWAP* on Sparc) 
writing a faster C macro.

Here's a pretty spreadsheet chart that shows the optimization (from calling the 
macros in a loop)
http://dan.drydog.com/reviews/6729208-bswap3-opt-chart.png
On the chart, OLD = current source, NEW=this webrev.
I measured on AMD64, EM64T, and sun4u boxen; times in milliseconds.

Please comment by COB Wed. Sept. 3.

--
This message posted from opensolaris.org

Reply via email to