Optimize Critical Section Functions

Robert Shearman rob at codeweavers.com
Sat Aug 21 11:50:18 CDT 2004


Alexandre Julliard wrote:

>Michael Stefaniuc <mstefani at redhat.com> writes:
>
>  
>
>>Andreas Mohr wrote:
>>    
>>
>>>Umm, this should go into a global header file, right?
>>>The theory being that it would be useful at many more performance critical
>>>Wine places...
>>>But I have to admit that I don't know which header file this should
>>>be...
>>>      
>>>
>>Like in the Linux kernel (where this seems to come from) in compiler.h
>>or something like that.
>>    
>>
>
>No, I don't think we want to do that, it would only encourage people
>to sprinkle this stuff all over the place believing they are
>"optimizing" the code. This should only be added in places where it
>makes a significant difference, demonstrated with benchmark results.
>  
>
Yes, I agree. In fact the patch actually decreases performance.
Test: 10,000,000 calls to EnterCriticalSection & LeaveCriticalSection, 
simulating fast path on critical sections.
Results:
Win2k - 1000ms
Wine w/ patch - 1346ms
Wine w/o patch - 1294ms

I think the best way to improve performance of the critical section 
functions is to rewrite them in assembly and I will submit a patch doing 
so when I have a spare moment.

Rob




More information about the wine-devel mailing list