[fpc-pascal] FPImage and GetDataLineStart

Marco van de Voort marcov at stack.nl
Thu Apr 21 22:05:06 CEST 2011


In our previous episode, Michael Van Canneyt said:
> >> You can propose whatever you want _but_ generics.
> >
> > Motivation?
> 
> Threefold:
> a) The compiler's handling of generics is still beta code in my opinion.
>     As far as I know, the original problem I reported when writing the docs
>     for them is still not solved.
> 
> b) It's demonstratibly slower than optimized classes.
>     (see the whole debate on core when it was started.
>      The problem is not an optimizer one, but the need to revert
>      to slower but more general programming techniques when using generics)
>     Since the idea is to make things faster, generics are a poor choice.
> 
> c) I want my own code to be 100% generics-free, and I happen to use fp-image a lot.
> 
> But if you want to write generics-based image handling classes, feel free 
> to put them in fcl-stl, just not in fp-image. I'll be glad to make some 
> reasonable changes to the base classes to make this possible.

I give you a. To be honest it is still a bit too early for Delphi even. But
I don't assume a fully optimized FCL-image is something short term anyway.

I don't understand what you mean with b at all. Sure generics is a typed
system, and if you focus on the birds-eye of view it is all as fast. (*)

The remark about stuffing generics in STL is something that doesn't make
sense. Generics are useless when not used.

As for c, for me it is totally the opposite. Without some thorough speedup,
fcl-image is totally unusuable for my purposes, even on the fringes. So for
me such things are totally ununderstandable. If you depend on this so much,
and with fcl-image having be pretty much static for the last decade, you
simply take a copy for own use ?

(*) imgconv takes _seconds_ to do some conversions that coded out in even
straight forward pascal take several ms at worst.  I can understand some
generalising making stuff a bit slower, but a factor 1000 is limiting for a
lot of uses, and unnecessary stressing the system for the rest.  I hope it
is clear I'm not talking about one or two instructions in a loop somewhere
here, but magnitudes, magnitudes more.




More information about the fpc-pascal mailing list