[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: interesting links




Sent from my iPhone

On Aug 30, 2007, at 10:19 AM, Peter Clifton <pcjc2@xxxxxxxxx> wrote:

>
> On Thu, 2007-08-30 at 13:10 -0400, DJ Delorie wrote:
>>> ... I'd say start by redesigning the data structures!  PCB could be
>>> so much more "OO" even without C++.  A lot of the code would be
>>> about 1/20th the size if you could just do things like
>>> foo->Move(dx,dy) without having to worry about the type of foo.
>>
>> You're not the first to think of that ;-)
>
> I was wondering if we ought to avoid similar kinds of code (such as a
> func pointer in each gschem/libgeda object to its drawing routine), as
> its just more data to load in memory per object. Also, in that case -
> the pointer conceptually belongs to gschem, but lives in libgeda.

If you have 300 foo objects you have 1full copy with all of the  
functions and 299 data only copies.  Of I recall correctly.
>
> I'm not sure what the performance hit might be in removing it, and  
> using
> a test on the object's type. I did consider it might be similarly fast
> if the object's type was an integer starting from 0, (or 1) not  
> various
> ASCII chars like 'l' etc.. We could then index an array of drawing
> function pointers with that type-code (after bounds testing if you
> like), and de-reference the desired class function that way.
>
> It hasn't bothered me enough to experiment with changing it yet.
>
> Peter
>
>
>
>
> _______________________________________________
> geda-user mailing list
> geda-user@xxxxxxxxxxxxxx
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user