Author Topic: Eagle CAD 7.7 - purge?  (Read 1678 times)

0 Members and 1 Guest are viewing this topic.

Offline RenateTopic starter

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Eagle CAD 7.7 - purge?
« on: June 02, 2020, 01:06:17 pm »
I'm still using Eagle CAD 7.7
I've resisted switching over to KiCAD because of the arcane file format.
Yes, the XML in Eagle is verbose, but at least clear.

I've always found using the enormous libraries annoying.
I usually use my own hand-picked/cleaned-up library.

Recently I knocked together a schematic of a dozen part taken directly from the stock libraries.
I was amazed to see that the schematic file was 0.5 Meg in size.
I'm used to CAD programs with a purge command, but it doesn't seem like Eagle has one.
Or did I miss it?

So I wrote a purger for Eagle.
One of the things that I then noticed is that libraries like resistor.lbr have enormous (15K) description fields of gooble-dee-gook HTML.
So now my schematic of a dozen parts is down to 40K, a reduction of 93%

I guess that in the 21st century we don't worry about file sizes. :(
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: gb
    • Electronic controls
Re: Eagle CAD 7.7 - purge?
« Reply #1 on: June 02, 2020, 01:20:15 pm »
I wrote my own PCBCAD package in the 1990's.
At that time it was still mostly Assembler so my data structures were full of 16 bit values and 16 bit words full of bit fields.
This made it incredibly compact.
Most modern stuff uses files full of text so uses up more room.

I had a customer email me complaining that my CAD software requires .net framework 4 to be installed on XP before it will run.
He complained about the size of it.
I had to explain that its part of Windows now anyway and that quite a bit of software requires it to run.
Even C++ requires C++ runtime libraries to run.
And .net core requires runtime software.

Time has moved on and hard discs have grown in capacity and speed.

 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Eagle CAD 7.7 - purge?
« Reply #2 on: June 02, 2020, 01:50:02 pm »

There is a "thing"  called EDIF...

Introduced in the late 80s and meant to solve
these issues of formats among EDA packages.

Neither one of the great ones even considered
changing a single bit of code to conform EDIF.

Closest one to EDIF was (and always in the advance) OrCAD
prior to their  change to Cadence.  OrCAD EDIF support is
one (if not the one) of the best.

Others went down the hole making each version a more
cumbersome version of their own formats. XML is not
exception...

Although some "translators" can be written based
on templates to convert XML to EDIF... no one  ever
bother to use EDIF already ready.. decades ago.

Funny enough to see the problem is still the very same.
Nothing changed several decades after EDIF introduced

Paul
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1063
  • Country: us
Re: Eagle CAD 7.7 - purge?
« Reply #3 on: June 02, 2020, 02:25:13 pm »
so what does your purger do exactly?  and are you sharing it?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15800
  • Country: fr
Re: Eagle CAD 7.7 - purge?
« Reply #4 on: June 02, 2020, 03:07:54 pm »
Not sure I completely got what you meant.

Eagle XML file format: I have actually written a C library for parsing that, so I've worked closely on the format. I must admit it's rather well structured overall, and contains a lot of useful information that's often missing in many other CAD formats.

As far as size goes, Eagle files actually embed all parts that are used in them, so that makes the files 100% stand-alone, but that can make them pretty big too. I don't quite remember if it does embed more parts (from the same library) than what it exactly uses - I think I'm understanding (from what you're saying) that it does. Although it would make files "bloated" (so I get the idea of "purging"), it's also an interesting "feature", as it allows others to actually retrieve potentially interesting parts from a given Eagle file, effectively making any Eagle file (schematic, layout, library) a usable library in itself.
 

Offline rachaelp

  • Supporter
  • ****
  • Posts: 156
  • Country: gb
Re: Eagle CAD 7.7 - purge?
« Reply #5 on: June 02, 2020, 04:10:01 pm »
As far as size goes, Eagle files actually embed all parts that are used in them, so that makes the files 100% stand-alone, but that can make them pretty big too. I don't quite remember if it does embed more parts (from the same library) than what it exactly uses - I think I'm understanding (from what you're saying) that it does.

As part of storing the specifics of the parts used in the design it will store all variants of those parts, so if you define an SMT resistor with all the footprints form 01005 to 2512 then the libraries embedded in the design will contain all those footprints. It makes it easy to update the design to change the package on something this way. You can actually strip this out if needs be with the library export function in the most recent versions of EAGLE as you can tell it to export only the used packages and then you update the design with the new exported libraries. If saving a few Mb is a concern it's an option, but with modern hardware and disk sizes the space taken up by EAGLE files is minuscule in comparison.

Best Regards,

Rachael
I have a weakness for Test Equipment so can often be found having a TEA break (https://www.eevblog.com/forum/chat/test-equipment-anonymous-(tea)-group-therapy-thread/)
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 800
  • Country: lt
Re: Eagle CAD 7.7 - purge?
« Reply #6 on: June 02, 2020, 05:11:19 pm »
I guess that in the 21st century we don't worry about file sizes. :(

Of course we don't. You can now buy 4TB HDD or 1TB SSD for less than $100 on Amazon. If you earn $20/hour and you spent more than 5 hours creating your "purge app" - you should've bought a new HDD instead.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15800
  • Country: fr
Re: Eagle CAD 7.7 - purge?
« Reply #7 on: June 02, 2020, 05:36:27 pm »
As far as size goes, Eagle files actually embed all parts that are used in them, so that makes the files 100% stand-alone, but that can make them pretty big too. I don't quite remember if it does embed more parts (from the same library) than what it exactly uses - I think I'm understanding (from what you're saying) that it does.

As part of storing the specifics of the parts used in the design it will store all variants of those parts, so if you define an SMT resistor with all the footprints form 01005 to 2512 then the libraries embedded in the design will contain all those footprints. It makes it easy to update the design to change the package on something this way

Oh OK! Now I remember more details indeed.

Yes, as hinted, Eagle embeds the exact same information for all parts in the design that it does when saving them in a library file. Library files are just particular cases of design files (schematics, pcbs) and contain the same information for parts AFAIR. I think this is actually a pretty handy feature.

Now regarding file size, since text files tend to compress very well, I would probably personally have taken the path of just compressing the files instead of "stripping" them. As an example, I just compressed an Eagle schematic file that was about 1.4MB, with 7-zip. It compressed to a mere 94KB...

OTOH, stripping them will remove any not directly needed data, and may be better for IP reasons if you're sharing them.
« Last Edit: June 02, 2020, 05:42:12 pm by SiliconWizard »
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 4034
  • Country: us
Re: Eagle CAD 7.7 - purge?
« Reply #8 on: June 03, 2020, 05:39:04 am »
I was amazed to see that the schematic file was 0.5 Meg in size.

Oh noes!

I just can't imagine a situation where anyone would care about this.  EDA tools have enough real problems: they are slow, buggy, crash a lot, have poor user interfaces, lack effective tools to reduce repetitive and error prone work, have confusing interactions between settings and features, and have poorly thought out user interfaces.  Some of these might even be related to inadequacies in the file formats.  A 500 kb fille is completely meaningless, especially when a generic compression tool will reduce that by 10x as SiliconWizard notes. 
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Eagle CAD 7.7 - purge?
« Reply #9 on: June 03, 2020, 05:46:19 am »
I was amazed to see that the schematic file was 0.5 Meg in size.

Oh noes!

I just can't imagine a situation where anyone would care about this.  EDA tools have enough real problems: they are slow, buggy, crash a lot, have poor user interfaces, lack effective tools to reduce repetitive and error prone work, have confusing interactions between settings and features, and have poorly thought out user interfaces.  Some of these might even be related to inadequacies in the file formats.  A 500 kb fille is completely meaningless, especially when a generic compression tool will reduce that by 10x as SiliconWizard notes.


That was my first thought as well.

I mean ok, half a meg for what is essentially a text file is a little crazy out of context, but when you consider a typical hard drive is *at least* 500GB these days half a meg is just nothing. I can attach a file 10 times that size to an email and it takes just a few seconds to get it.
 

Offline RenateTopic starter

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Eagle CAD 7.7 - purge?
« Reply #10 on: June 03, 2020, 02:19:13 pm »
I guess some people don't like bloat for a personal reason and some don't care.
My personal taste goes for lean and mean.

Code: [Select]
C:\>eglpurge test.sch
Found 9 parts
devices        236
packages       236
(That's 236 devices and packages removed. Quite a bit for a circuit with 9 parts.)

Sure, I'll release this utility.
I've just got to give it some spit and polish.
Erm, I mean, wipe it down with isopropyl alcohol.

Oh, since size doesn't matter, did I mention that this utility is 230 Megs, reguires 2 different versions of .NET and uses 11 extra DLLs?
It requires registration, will only work when you are online and continually sends analytics to me?  :-DD
« Last Edit: June 03, 2020, 03:58:59 pm by Renate »
 

Offline RenateTopic starter

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Eagle CAD 7.7 - purge?
« Reply #11 on: June 04, 2020, 01:02:09 am »
So, here it is: http://www.temblast.com/download/eglpurge.exe
Code: [Select]
C:\>eglpurge /?                    Usage
C:\>eglpurge test.sch              Check, but don't modify anything
C:\>eglpurge test.sch  mod.sch     Purge, write to other file
C:\>eglpurge test.sch  /r          Purge, write back to original file
C:\>eglpurge test.sch  /r /v       Purge, write back to original file, verbose

After doing a bunch of experimenting, it looks like Eagle does try to get rid of superfluous things.
It's just that it never purges devicesets correctly.

eglpurge.exe will also work on .brd files.
It's just that I could never find a way to pollute a board file.
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: gb
    • Electronic controls
Re: Eagle CAD 7.7 - purge?
« Reply #12 on: June 04, 2020, 11:21:17 pm »
After doing a bunch of experimenting, it looks like Eagle does try to get rid of superfluous things.
It's just that it never purges device sets correctly.
The PCBCAD software  I wrote holds component definitions in with the schematic and pcb.
It throws out any that are no longer used as it goes along so no need for a purge.
All this keep memory and hard disc usage down.
I also have a component update command that updates the component and its definition from the library.
A more powerful command updates the whole sch or pcb in one go.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf