[fpc-pascal] Generics vs templates
pascaldragon at googlemail.com
Tue Jan 9 10:41:00 CET 2018
Am 09.01.2018 08:13 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:
> On Jan 9, 2018, at 2:04 PM, Sven Barth via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:
> But you need to program in a way that allows the usage of multiple,
different types. That can more often than not lead to worse performance.
Examples? I had to add some if statements in a couple areas I didn’t want
to and a virtual method but beyond that I don’t see what would affect
Precisely these virtual methods are one point. They might not add much by
themselves, but if they're called for each Add or Remove operation they can
add quite a bit.
Why do you think that the TFP(Object)List classes don't have notification
support unlike T(Object)List? Even if it only checks whether a notification
handler is assigned it's enough for a noticeable difference in performance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal