Hi, Please try using -xbuiltin and see if that helps. The flag enables the compiler to recognise and inline short calls to memcpy etc.
Regards, Darryl. On 3/29/2010 7:04 PM, ????? ???????????? wrote: > VIS or not, removing all the code which checks for alignment and size > to pick an optimized code path would be a win even for the icache. The > discussion however is only theoretical because ON uses Sun Studio and > not gcc as primary compiler and Studio has no option to inline > memcpy() or strcpy() for known size and alignment, leaving as last > resort only hand written assembler. > > The application is no micro benchmark, it is a real application which > does many string operations. > > Olga > > 2010/3/30 Bart Smaalders<bart.smaalders at sun.com>: >> On 03/29/10 15:41, ????? ???????????? wrote: >>> >>> The libc mem* instructions use VIS but they are still suboptimal for >>> small fixed size copies because they impose a significant overhead by >>> *always* testing the size and alignment. For copies smaller than 48 >>> bytes the overhead is even greater than the size of data copied, >>> making it inefficient compared to an inlined chain of VIS >>> instructions. >>> >>> Olga >> >> I would be surprised if VIS offered any real advantages in >> copies of less than 48 bytes; perhaps if the copies are >> misaligned VIS may help. Be very careful about inlining >> memcpy; while this improves performance on microbenchmarks, >> the adverse effects of icache hit rate on real world code >> generally leads one in the other direction. -- Darryl Gove Compiler Performance Engineering Blog : http://blogs.sun.com/d/ Books: http://www.sun.com/books/catalog/solaris_app_programming.xml http://my.safaribooksonline.com/0595352510