<div dir="ltr"><div dir="ltr">On Fri, Feb 22, 2019 at 2:35 AM Ben Grasset <<a href="mailto:operator97@gmail.com">operator97@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 16, 2019 at 5:44 PM Benito van der Zander <<a href="mailto:benito@benibela.de" target="_blank">benito@benibela.de</a>> wrote</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>it can turn out the enumerators are slower than an old school
loop</div></div></blockquote><div><br></div><div>The trick with enumerators is to never make them classes, and use advanced records instead, I've found. This way you avoid the heap allocation and the implicit try/finally. Also make sure you inline the MoveNext and GetCurrent! </div></div></div><br></blockquote><div> How do you make a (for in) enumerator with a record? I don't use them for exactly this reason, and they did seem to be another useful language feature that turned out to be poorly implemented by Embarcadero. (Haven't checked with FPC).</div></div></div>