Dr-Emann / applesauce

Transparent compression for Apple File System Compression (AFSC)
GNU General Public License v3.0
13 stars 0 forks source link

applesauce compresses at a negative rate #85

Open rhizoome opened 3 days ago

rhizoome commented 3 days ago

It should probably not attempt to compress files that are smaller than the file-systems block size.

» applesauce info pyvenv.cfg
pyvenv.cfg is not compressed
Uncompressed size: 343
Number of extended attributes: 1
Size of extended attributes: 11 bytes
» applesauce compress --verify --minimum-compression-ratio 0.9 pyvenv.cfg                          [20:17:17]
                   Total: ██████████████████████████████████████████████████████████       343 B/343 B       0s    Total Files: 1
New Files Compressed: 1 (1 total compressed)
Starting Size (total filesize): 343 B (343)
Starting Size (on disk):        4 KiB (4096)
Final Size (on disk):           4 KiB (4096)
Savings:                        0.0%
» applesauce info pyvenv.cfg                                                                            [20:18:42]
pyvenv.cfg is compressed
Compression type: LZFSE in decmpfs xattr
Uncompressed size in decmpfs xattr: 343
Uncompressed size: 343
Compressed size: 4096
Compression savings: -1094.17%
Number of extended attributes: 1
Size of extended attributes: 11 byte
rhizoome commented 3 days ago

EDIT: Having read the code I understand that this is only a display error.

rhizoome commented 3 days ago

I checked with this program. The compressed size is 246, so it is just a display error. It should display the size of the xattr, not the block-size.