Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Optimized memcmp for x86
Re: Optimized memcmp for x86 [message #14756 is a reply to message #14489] |
Wed, 12 March 2008 21:27  |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
mr_ped wrote on Wed, 27 February 2008 05:43 | I was thinking about it a bit more, and I think some serious profiling data should be gathered, i.e. how often it is called with aligned pointers.
I think this function itself is rarely used?
And if it is, it may often be used to search trough strings?
And in such case the pointers will be not aligned very often?
I mean, is this really worth of effort? Only some profiling of real applications can tell.
But it was nice mental exercise anyway. 
|
Well, the primary motivation was the speedup for small strings - there data definitely are aligned and even the number of characters is fixed.
This optimization seems to bring in about 5% improvement to container benchmark where Sort is used. That is not bad.
Anyway, for non-small strings, we do have guarantee that data are always aligned, so I will probably directly use even unaligned version For String alone, this optimization is worthwhile.
Mirek
|
|
|
Goto Forum:
Current Time: Sat Aug 23 21:40:33 CEST 2025
Total time taken to generate the page: 0.04051 seconds
|