kernel32 & winelib: Don't test string size in CompareStringW fornull terminated strings

Dmitry Timoshkov dmitry at codeweavers.com
Sun Mar 2 09:26:02 CST 2008


"Adam Strzelecki" <ono at java.pl> wrote:

> I believe the further discussion is pointless. If you ever dared to  
> look how MSVCRT or GLIBC strlen function is implemented you would know  
> that it is exactly same algorithm (that just differs in the  
> implementation) using 4 byte fetching with magic bits matching, also  
> described in few books and articles, let me name one: "Write Great  
> Code, Volume 2: Thinking Low-Level, Writing High-Level" ISBN  
> 1593270658, section 10.1.1.1 about using string manipulation routines,  
> so there's nothing about Microsoft's or anybody's else secret invention.

Wine already had at some point strlen along with some other string functions
implemented in asm, however they have been removed after it was proved that
gcc optimized C code outperforms it.

> To be clear, my only intention was to point you that Wine's  
> CompareStringW can be better. IMHO it is very respectable to not only  
> write code that is well organized and bug-free that Wine is in my  
> opinion, but also to write performance aware code, which IMHO Wine is  
> NOT.

You are welcome to show the results of the benchmark which show how much
your patch improves performance.

-- 
Dmitry.



More information about the wine-devel mailing list