top | item 44508587

(no title)

dikei | 7 months ago

I use ZSTD a ton in my programming work where efficiency matters.

But for sharing files with other people, ZIP is still king. Even 7z or RAR is niche. Everyone can open a ZIP file, and they don't really care if the file is a few MBs bigger.

discuss

order

cesarb|7 months ago

> Everyone can open a ZIP file, and they don't really care if the file is a few MBs bigger.

You can use ZSTD with ZIP files too! It's compression method 93 (see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT which is the official ZIP file specification).

Which reveals that "everyone can open a ZIP file" is a lie. Sure, everyone can open a ZIP file, as long as that file uses only a limited subset of the ZIP format features. Which is why formats which use ZIP as a base (Java JAR files, OpenDocument files, new Office files) standardize such a subset; but for general-purpose ZIP files, there's no such standard.

(I have encountered such ZIP files in the wild; "unzip" can't decompress them, though p7zip worked for these particular ZIP files.)

throw0101d|7 months ago

> You can use ZSTD with ZIP files too!

Support for which was added in 2020:

> On 15 June 2020, Zstandard was implemented in version 6.3.8 of the zip file format with codec number 93, deprecating the previous codec number of 20 as it was implemented in version 6.3.7, released on 1 June.[36][37]

* https://en.wikipedia.org/wiki/Zstd#Usage

So I'm not sure how widely deployed it would be.

dikei|7 months ago

Well, only a lunatic would use ZIP with anything but DEFLATE/DEFLATE64

easton|7 months ago

> new Office files

I know what you mean, I’m not being pedantic, but I just realized it’s been 19 years. I wonder when we’ll start calling them “Office files”.

guappa|7 months ago

You can and I've done it… but you can't expect anything to be able to decompress it unless you wrote it yourself.

sidewndr46|7 months ago

Same thing with "WAV" files. There's at least 3 popular formats for the audio data out there.

justin66|7 months ago

> Copyright (c) 1989 - 2014, 2018, 2019, 2020, 2022

Mostly it seems nutty that, after all these years, they’re still updating the zip spec instead of moving on to a newer format.

Akronymus|7 months ago

So thats why rarely the customer cant open one of the zip files we send over.

notepad0x90|7 months ago

I don't know about, had a dicey situation recently where powershell's compress-archive couldn't handle archives >4GB and had to use 7zip. it is more reliable and you can ship 7za.exe or create self-extracting archives (wish those were more of a thing outside of the windows world).

landl0rd|7 months ago

I understand that security has to compromise for the real world, but a self-extracting archive is possibly one of the worst things one could use in terms of security.

sidewndr46|7 months ago

What are you compressing with zstd? I had to do this recently and the "xz" utility still blows it away in terms of compression ratio. In terms of memory and CPU usage, zstd wins by a large margin. But in my case I only really cared about compression ratio

vlovich123|7 months ago

people tend to care about decompression speed - xz can be quite slow decompressing super compressed files whereas zstd decompression speed is largely independent of that.

People also tend to care about how much time they spend on compression for each incremental % of compression performance and zstd tends to be a Pareto frontier for that (at least for open source algorithms)

landl0rd|7 months ago

I usually see zstd on max settings outperform xz on speed and very slightly on compression (though that's a tiny difference).

Szpadel|7 months ago

in my experience using zstd --long --ultra -22 gives marginally better compression ratio than xz -9 while being significantly faster

xxs|7 months ago

do you have examples where xz 'blows it away', not just zstd -3?

jart|7 months ago

Use the pigz command for parallel gzip. Mark Adler also has an example floating around somewhere about how to implement basically the same thing using Z_BLOCK.

mrWiz|7 months ago

My main use case for 7z is bypassing corporate filters that block ZIPs from being sent.

starik36|7 months ago

I think gmail is onto you. They blocked one of my 7z files the other day.

psyclobe|7 months ago

zip is such a shit standard, hell there are parts of it that are still undocumented and sharing documents between system zip implementations across mac and windows sometimes fails.