Hello,
I am using performance monitoring tools to track bottlenecks in my application.
while doing so, the function CallThreadProcSafe from unit MadExcept is topping the list.
according to the attached screenshot, it is called once and is taking over 50% of the execution time.
This probably doesn't make sense, but I was just curious as to what this procedure does.
Memory leak detection (known to be slow) are not enabled in this execution, so the above is resulting from the exception handling aspect of MadExcept.
Any ideas which might help clear out the misunderstanding?
Thanks!
CallThreadProcSafe and performance monitoring tools
Re: CallThreadProcSafe and performance monitoring tools
CallThreadProcSafe basically encapsulates your thread functions in order to be able to inject a try..except block into them. So CallThreadProcSafe basically looks like this:
Code: Select all
function CallThreadProcSafe(originalThreadProc) : integer;
begin
try
result := originalThreadProc;
except
HandleException()
end;
end;
Re: CallThreadProcSafe and performance monitoring tools
so from your description, I understand that there should be no extra cost added by this procedure, unless an exception is raised (which, if it wasn't for MadExcept, would have propagated the Exception further upwards anyway).
thanks again!
thanks again!
Re: CallThreadProcSafe and performance monitoring tools
There is no meaningful cost added by this procedure. Generally, madExcept is not supposed to slow down anything, unless there's an exception.