<HTML>
<div><style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>The information in the Wiki about how exception frames are set up is pretty nice. I didn't know that 'raise' creates an exception frame for the procedure it appears in, but explains why it's often shipped off to another local procedure. Very useful information!</div><div><br>
</div><div>True though, it's hard to generalise the performance impact of exception handlers and try...finally blocks, although I think the simple rule of thumb is that there is a performance hit no matter what you try.<br>
</div><div><br>
</div><div>Gareth aka. Kit<br>
</div> <br>
<br>
<span style="font-weight: bold;">On Thu 02/08/18 06:54 , Sven Barth via fpc-devel fpc-devel@lists.freepascal.org sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT:0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Kirinn <<a href="mailto:kirinn@mooncore.eu">kirinn@mooncore.eu</a>> schrieb am Mi., 1. Aug. 2018, 23:30:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
Inspired by Gareth aka. Kit's infectious enthusiasm, and the recent long <br>
discussion on exceptions on this list, I wrote up an article on <br>
Exceptions on the FPC wiki. (Strangely enough we didn't have one before.)<br>
<br>
<a href="http://wiki.freepascal.org/Exceptions" rel="noreferrer noreferrer" target="_blank">http://wiki.freepascal.org/Exceptions</a><br>
<br>
I hope it'll be useful, and not entirely inaccurate! Particularly the <br>
part about performance. If a programmer knows exactly what each <br>
exception statement inserts in the code, that should help in deciding <br>
when to worry about the performance, and when to embrace the convenience.<br>
</blockquote></div></div><div dir="auto"><br>
</div><div dir="auto">Please note that you can't generalize the performance impact as it depends on the used exception handling mechanism. By default FPC uses setjmp/longjmp which exhibit the behavior you described. On Win64 however SEH is used which - in that platform - relies on metadata inside the binary to mark the areas for a protected block (no matter whether it's for "except" or "finally"). On Win32 with SEH enabled (which isn't the default currently) it is again different. And should we decide to support DWARF exception frames that would again be different. </div>
<div dir="auto"><br>
</div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a target="_blank" href="<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>"><span style="color: red;">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</span></a><br>
<br>
</blockquote></HTML>