<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jan 30, 2016 at 2:19 PM, silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span><div class="gmail_quote">On Fri, Jan 29, 2016 at 8:28 AM, Marco van de Voort <span dir="ltr"><<a href="mailto:marcov@stack.nl" target="_blank">marcov@stack.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>In our previous episode, silvioprog said:<br>
> > The format of interface VMTs could also differ per platform so considering<br>
> > that as more stable only holds true because of what we currently support.<br>
> ><br>
>  Sorry for ask here, but, don't you recomment to use interfaces? I'm making<br>
> a project and I'm planning to use some COM interfaces to make something a list<br>
> adapter<br>
</span>> <<a href="http://developer.android.com/reference/android/widget/ListAdapter.html" rel="noreferrer" target="_blank">http://developer.android.com/reference/android/widget/ListAdapter.html</a>>.<br>
<br>
Interfaces are relatively slow. Not only because of the refcounting, but<br>
returning interfaces in a tight loop (e.g. to get the elements of an<br>
enumeration) would be a new allocation each time.</blockquote></div><br clear="all"></span><div>Hm... I didn't know that.</div><div><br></div><div>I need to take a test using some profiling tool to check the real cost using interfaces, because in my case I'm using lists. However, I still can't understand why some programmers avoid to use interfaces in Pascal. :-/ </div></div></div></blockquote></div><div><br></div><div>Well, I did a simple test. Result:</div><div><br></div><div><div><font face="monospace, monospace">C: 00:00:11.008</font></div><div><font face="monospace, monospace">I: 00:00:14.555</font></div><div><font face="monospace, monospace">I: 00:00:14.511</font></div><div><font face="monospace, monospace">C: 00:00:10.880</font></div><div><font face="monospace, monospace">Press [ENTER] to exit ...</font></div></div><div><br></div><div class="gmail_extra">Source: <a href="http://pastebin.com/x74V4gEx" target="_blank">http://pastebin.com/x74V4gEx</a> .</div><div class="gmail_extra"><br></div><div class="gmail_extra">It seems that the COM interfaces is a little bit slower than classes. Anyway, I don't have problem to use interfaces, however I'll use it only when it is really necessary.</div><div class="gmail_extra"><br></div>-- <br><div><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>