Optimize Critical Section Functions

Alexandre Julliard julliard at winehq.org
Sat Aug 21 12:10:39 CDT 2004

Robert Shearman <rob at codeweavers.com> writes:

> 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.

I don't think that's necessary either, unless you have good evidence
that the critical section non-contention path represents a significant
amount of the total time spent by an application. IMO we have much
bigger performance issues to solve first, before we make the critical
section code unreadable just to save a couple of cycles.

Alexandre Julliard
julliard at winehq.org

More information about the wine-devel mailing list