ODT documents accumulate internal leftover formatting remnants from editing. As a document is repeatedly edited, the file size grows significantly more than is required to render the document. To show what I mean, do the following:
- Create a new document consisting of the sentence “This is a test.”
- Save the document to “test1.odt”.
- Change the word “is” to bold.
- Save-As the document to a differnt file: “test2.odt”.
- Close and reopen “test2.odt”.
- Unbold the word “is”.
- Save the document one more time.
You should have two apparently identical documents, but “test2.odt” is 157 bytes larger than “test1.odt”. This is due to the retained formatting remnants. They can be seen by converting the documents to RTF and comparing them.
When performing many edits on large documents, this can significantly increase the file size to many times what its should be. (Just the simple edit example above added 157 bytes). And I expect it slows down document loading and saving.
I’m working on a Bash script to clean up a documemt by removing redundant or unnecessary formatting codes, but I wonder if such a tool already exists. If not, Writer should automatically clean up the documemt as it saves it.