# XML Project Bloat

**URL:** <https://forum.xojo.com/t/xml-project-bloat/38546>\
**Category:** General\
**Created:** [July 5, 2017, 7:43pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546 "2017-07-05T19:43:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [July 5, 2017, 7:43pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/1 "2017-07-05T19:43:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [July 5, 2017, 7:52pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/2 "2017-07-05T19:52:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [July 5, 2017, 7:59pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/3 "2017-07-05T19:59:50Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [July 5, 2017, 8:06pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/4 "2017-07-05T20:06:05Z")

</div>

[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.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [July 5, 2017, 8:14pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/5 "2017-07-05T20:14:17Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [July 5, 2017, 8:41pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/6 "2017-07-05T20:41:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [July 5, 2017, 9:00pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/7 "2017-07-05T21:00:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [July 5, 2017, 9:03pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/9 "2017-07-05T21:03:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [July 5, 2017, 9:07pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/10 "2017-07-05T21:07:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [July 5, 2017, 9:18pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/11 "2017-07-05T21:18:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [July 5, 2017, 9:23pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/12 "2017-07-05T21:23:09Z")

</div>

The question was more of a curiousity than anything else…

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:50pm UTC](https://forum.xojo.com/t/xml-project-bloat/38546/13 "2020-10-29T18:50:14Z")

</div>


