XML Project Bloat

I have an Xojo project that I save in XML format… and recently I noticed that the XML file is over 23.5meg in size
now there are a lot of graphics (860k if I examine the compiled bundle)… and I realize that XML stores that is HEX format in the project file… but even being generous and saying 5x the space required… that is only 4.3meg… there are 16,000 lines of code… again being generous say 100 char per line… that is 1.6meg
so I can account for 4.9meg… toss in 50% for “overhead” that is 7.5meg… what in the world is taking up the other 16 meg?!

When saved in BINARY format it is 13.1 meg

There is nothing “wrong”… I just noticed that it seems to jump in size all of a sudden.

16,000 lines is going to give you 32,000 SourceLine tags.
So that could be a source of bloat.

What’s wrong with the plain text format?

Tim… 16,000 lines of code… I used 100 characters to line in my estimate… I’d say the average is closer to 50 (“ELSE” is only 4)
So I double the sourceline tags account for 16 meg of extra overhead, since they only add 33 characters per line

not sure what you mean by [quote=339097:@Tim Parnell]What’s wrong with the plain text format?[/quote]

[quote=339100:@Dave S]Tim… 16,000 lines of code… I used 100 characters to line in my estimate… I’d say the average is closer to 50 (“ELSE” is only 4)
So I double the sourceline tags account for 16 meg of extra overhead, since they only add 33 characters per line

not sure what you mean by[/quote]
The plain text format - the not XML, yet still VCS friendly format.

Have you read the XML? If there’s even a blank line it reads, <SourceLine> </SourceLine>. You have to add the length for <SourceLine></SourceLine> to every line you’re calculating. So your average 50 char line, is now 75. Every extra space line is now at least 25 characters (not even counting the indentations), and if you space a lot, you’re throwing in a lot of empty <SourceLine> </SourceLine> tags.

It’s all guesswork because I don’t know what your project looks like, but there could be a lot of wasted tags eating up space. Try switching to plain text.

You mean “VCS format”… which I find to be a pain (I like projects in one “package” (ie. file)… but that is my preference
but for the sake of this discussion… I saved it as such… and the sum total of all the files in the VCS folder was 12.1 meg of which 10 meg was all the graphics (I still not sure how 860k became 10meg even)

oh well… I’m not going to obsess over it…

Every image in your project is in there in a hexadecimal form for the image data
Every image has a reference - not the image data

XML will never be smaller than the binary since its literally the binary project written as XML

And you’ll have all the UIState in there as XML

If you’re not using VCS I’d use binary as it is more compact

Xojo probably doesn’t store the images in a compressed format.

Lets see … app icons would be in there in their full glory
They’re not stored as references to items on disk
There’s a few like this that would take up a pile of space

Right, but it being in hex doesn’t say anything about comression. Say I’ve got a 1000x1000 pixel image that’s 4mb uncompressed. Compressed, it may take 300k of disk. I know that Xojo loads the image at runtime in uncompressed form. If you also store it that way in the VCS format, that would account for the difference in size. I thought images in XML and binary formats were stored as references, though.

Not all items are references
Some do get copied right in - like App icons, FileType icons and a few others

These are things that in text format end up in the res file

In Binary & XML the res file is part of the binary & xml itself
As is the UIState

The question was more of a curiousity than anything else…