[Patch] XML dump compression
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
This patch, developed in collaboration with Pierre, introduces the ability for the compiles on Windows to compress the node dump XML files if the file system supports it (i.e. NTFS). This aims to reduce an occasional problem where the size of node dumps such as that of System, SysUtils and Classes produce excessively large XML files that can result in disk full errors on machines with limited space, such as laptops.
Steps to reproduce:
Apply patch, make the compiler with the -dDEBUG_NODE_XML option and confirm both successful compilation and the resultant *-node-dump.xml files to be compressed when run on a NTFS-formatted hard disk.
Additional information:
Currently, other platforms and file systems, like Btrfs, are not yet supported, but the capacity for extension does exist, since the API functions that enable file compression are contained within a new "def_createfile" function in compiler/comphook.pas.
If enabling compression fails due to lack of support or an access denied error, a note is posted to the console but compilation continues with the node dumps uncompressed.
Currently, only the XML node dumps use "def_createfile", but since it works with the "Text" type, it can easily act as a drop-in replacement for Assign/Rewrite pairs fo text files elsewhere should compression be desired (e.g. for the assembly language dumps).
This file system-level compression is best suited for files that are seldom written to, such as logs and text files with a lot of repetitive words, so assembly language files with all the common register names would be ideal too.
Mantis conversion info:
- Mantis ID: 38221
- OS: Microsoft Windows
- OS Build: 10 Home
- Build: r47781
- Platform: Windows source machines
- Version: 3.3.1