[fpc-devel] for-in-index loop
luiz americo pereira camara
luizmed at oi.com.br
Sun Jan 27 16:27:12 CET 2013
2013/1/26 Sven Barth <pascaldragon at googlemail.com>:
> On 26.01.2013 12:52, Alexander Klenin wrote:
>>
>> On Sat, Jan 26, 2013 at 10:50 PM, Sven Barth
>> <pascaldragon at googlemail.com> wrote:
>>>>
>>>> Generics was implemented without my knowledge. I only found out when
>>>> suddenly
>>>> the classes unit had been changed to use them. After a horrible
>>>> discussion, this was reversed, because of the drop in speed you got when
>>>> using generics.
>>>
>>>
>>> Ah! So that is where those ifdefs in classes come from :) I always
>>> wondered...
>>>
>> Is the drop still present/essential? Perhaps optimizer is now good
>> enough to drop those ifdefs?
>
>
> Someone would need to test this. It could be that the generic variant is
> less optimal, because the generic list is built upon a list that handles
> pointers...
>
I did some test with generics last year:
http://lazarusroad.blogspot.com.br/2012/06/cost-of-using-generics.html
I would not use in classes unit
Luiz
More information about the fpc-devel
mailing list