← Back to team overview

kicad-developers team mailing list archive

Re: library structure


On 9/24/2010 3:41 PM, Marco Serantoni wrote:
> On 23/set/2010, at 21.50, Dick Hollenbeck wrote:
>>> We could use a "base library" that is referred from "specific parts
>>> library" as "father" using its symbol like classes (inherance).
>>> So who wants heavy libraries has its parts, who keeps its library
>>> light has its part fallbacking to the father.
>> Inheritance.  hmmm.  Why not just *copy* symbol by symbol and make each
>> copied symbol into a part-specific component in a new project specific
>> library.
> Because we have load the same symbol multiple times, wasting in large
> libraries a lot of memory , so i'm suggesting a pointer to base symbols.


When I saw the phrase "a lot of memory" the engineer in me wondered just
how much is "a lot of memory".  So I add some debugging code to dump the
size of the drawing objects, made the assumption that the typical pin
name length is four characters and proceeded to calculate how much
memory would be save by using shared symbol pointers for 74xx.lib which
one of the largest libraries in Kicad and contains the most shared
symbols.  The 74xx.lib library contain 137 components with 34 aliases.
After doing some simple calculations, I determined the memory savings
for the 74xx.lib was ~107KB on a 32 bit Windows build.  If we were still
in the days of computers with 640KB of memory, this would account for
1/6th of the total system memory.  In this case using shared pointers
would save a lot of memory.  But with virtually all new computers
(including netbooks) ship with Windows 7, I haven't seen any systems
advertised recently with less than 2GB of memory.  I this case, it
represents 0.005% of the system memory.  Even if you loaded 10 libraries
in a project with similar numbers you would only still represent 0.05%
of the system memory.  Clearly this is not a lot of memory.  I'm not
suggesting that we don't pay attention to memory usage.  I am suggesting
that we make design choices based on quantifiable data.  I don't think I
would lose much sleep over not using shared pointers when loading
libraries into memory.

> --
> Marco
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

Follow ups