I'm profiling Wine with cprof http://opensource.corel.com/cprof.html
and I am curious as to why lstrlenA has a __TRY, __EXCEPT wrapper
around a strlen call. The exception handling is 2/3 of the execution time.
I also noticed that the exception handling isn't used outside the string
functions. lstrlenA is in the top 20 function calls.
So its a tradeoff between speed and stability. Good fodder
for a discussion, and probably only resolvable by a configure
option. Before and after output is below...
-Jim
With the exception handling:
Function Name calls func% func(ms) f+c% f+c(ms)
WINPROC_CallWndProc 34336 950694057.137 40899241012838 61.644
2651958
1995 950693972.543 40899237373573 100.000
4302042
server_call_noerr 279810 93.573 4025559 94.120 4049100
TryEnterCriticalSection 39993165 2.421 104148 5.724 246233
CRITSECTION_EnterCriticalSection 36801339 1.984 85331 11.492 494402
CRITSECTION_LeaveCriticalSection 36801338 1.922 82694 5.577 239904
__get_teb 119747280 1.855 79819 1.855 79819
EnterCriticalSection 39915277 1.402 60327 7.798 335478
InterlockedDecrement 40009039 1.341 57704 2.038 87666
LeaveCriticalSection 39993164 1.334 57388 3.564 153321
GetCurrentThreadId 39993177 1.316 56628 1.943 83583
GetCurrentProcessId 37422520 1.257 54088 3.052 131309
PROCESS_Current 37954554 1.243 53474 1.823 78409
InterlockedExchangeAdd 53187500 0.922 39650 0.922 39650
InterlockedCompareExchange 39993899 0.687 29538 0.687 29538
send_request 280074 0.539 23205 0.543 23378
lstrlenA 8145374 0.451 19381 0.690 29690
InterlockedIncrement 13178461 0.450 19347 0.675 29035
X11DRV_DIB_GetImageBits 55 0.443 19045 0.472 20309
EXC_push_frame 8527665 0.126 5434 0.126 5434
EXC_pop_frame 8527666 0.125 5356 0.125 5356
BITBLT_GetSrcArea 11733 0.119 5138 0.152 6517
_EnterSysLevel 1487530 0.092 3975 0.467 20094
_LeaveSysLevel 1487530 0.087 3760 0.269 11580
LCMapStringA 110932 0.074 3181 0.140 6043
X11DRV_DIB_SetImageBits_24 884 0.066 2854 0.066 2854
BITBLT_InternalStretchBlt 99757 0.053 2299 0.433 18628
OLE2NLS_isPunctuation 3490546 0.052 2232 0.052 2232
X11DRV_DIB_SetImageBits 1253 0.051 2201 0.120 5180
[snip]
And without:
Function Name calls func% func(ms) f+c% f+c(ms)
WINPROC_CallWndProc 24080 1270822242.050 40899241254689 60.181
1936812
1701 1270822155.129 40899238457284 100.000
3218330
server_call_noerr 199011 91.219 2935726 91.639 2949232
TryEnterCriticalSection 32758371 2.514 80916 5.918 190444
CRITSECTION_EnterCriticalSection 29248591 1.963 63183 11.495 369958
CRITSECTION_LeaveCriticalSection 29248590 1.931 62155 5.596 180098
__get_teb 97384526 1.888 60757 1.888 60757
EnterCriticalSection 32692276 1.430 46018 7.877 253493
LeaveCriticalSection 32758370 1.383 44513 3.617 116408
InterlockedDecrement 32772561 1.381 44460 2.095 67417
GetCurrentThreadId 32758382 1.359 43721 1.994 64189
PROCESS_Current 30111906 1.256 40406 1.838 59140
GetCurrentProcessId 29628267 1.236 39781 3.044 97950
InterlockedExchangeAdd 43758230 0.951 30621 0.951 30621
InterlockedCompareExchange 32759039 0.707 22756 0.707 22756
InterlockedIncrement 10985669 0.465 14964 0.703 22628
send_request 199271 0.412 13271 0.416 13395
X11DRV_DIB_GetImageBits 36 0.392 12611 0.419 13491
lstrlenA 6467367 0.157 5060 0.157 5060
_LeaveSysLevel 1905678 0.131 4206 0.404 13007
_EnterSysLevel 1905678 0.130 4195 0.671 21582
BITBLT_GetSrcArea 9365 0.107 3455 0.140 4507
BITBLT_InternalStretchBlt 162508 0.092 2958 0.612 19710
X11DRV_DIB_SetImageBits_24 874 0.085 2725 0.085 2725
LCMapStringA 94340 0.084 2702 0.156 5032
GDI_GetObjPtr 1493610 0.069 2220 0.584 18783
GDI_ReleaseObj 1491667 0.066 2115 0.357 11477
[snip]
And for those who don't like to dig through cprof ouput:
Function Name calls func% func(ms) f+c% f+c(ms)
lstrlenA(with) 8145374 0.451 19381 0.690 29690 (slightly longer run)
lstrlenA(without) 6467367 0.157 5060 0.157 5060
--
The address in the headers is not the poster's real email address. Do not send
private mail to the poster using your mailer's "reply" feature. CC's of mail
to mailing lists are OK. Problem reports to "[EMAIL PROTECTED]".
The poster's email address is "[EMAIL PROTECTED]".