<div dir="ltr"><div dir="ltr"><br></div><br><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">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>