News for hackers. Stuff that matters.
Re:Zstandard v1.3.4 – faster everything by koolba on Friday March 30, 2018 @02:45PM (#16718741)
One of the coolest parts of zstd is the simple support for custom dictionaries. If you have a lot of mid sized blobs that you want to separately compress (so that you can separately decompress them), you can create a common dictionary that covers the entire corpus. In real world use cases the compression ratio can go from 3x to 9x: https://github.com/facebook/zstd#the-case-for-small-data-com...

What was the finality on the issue of patents with this library? Is there an active covenant from Facebook not to sue users?

Re:Zstandard v1.3.4 – faster everything by hinkley on Friday March 30, 2018 @03:30PM (#16719091)
This is a little known feature borrowed from zlib, and possibly predates even that.

I ran into this many moons ago while working on a large J2ME app, trying to shrink the zip file. We hit the point where looking a lot the compression algorithm was our next most reasonable step, and since I had prior zlib experience decoding PNGs, I dug into it.

I discovered that Sun had partly exposed the dictionary support and I ended up filing an enhancement request and some numbers for my POC. But as it turns out Sun had already begun work on their dense archive format which achieved a multiple of the improvements I was getting, so it went nowhere.

Alphabetizing the constant pool got us a fraction of the benefit, and I discovered that because of the way the constants are stored, suffix sorting them got us another 1.1% compression so I dropped it.

Re:Zstandard v1.3.4 – faster everything by terrelln on Friday March 30, 2018 @03:04PM (#16718879)
The library is dual licensed under plain BSD [1] and GPLv2 [2].

[1] https://github.com/facebook/zstd/blob/dev/LICENSE [2] https://github.com/facebook/zstd/blob/dev/COPYING

Re:Zstandard v1.3.4 – faster everything by koolba on Friday March 30, 2018 @03:14PM (#16718969)
Which only makes things more confusing. Is it dual licensed, both apply? Or dual license, your choice? That only complicates the patent question further.
Re:Zstandard v1.3.4 – faster everything by terrelln on Friday March 30, 2018 @03:19PM (#16719001)
The GPLv2 license was added for inclusion in the kernel, you may choose either GPLv2 or BSD. See the header file https://github.com/facebook/zstd/blob/dev/lib/zstd.h.
Re:Zstandard v1.3.4 – faster everything by koolba on Friday March 30, 2018 @03:27PM (#16719070)
Sweet. Would be nice if that was in the README too as it only mentions the BSD license, but the top level includes the GPL as well.

There's still the open patent question but this (i.e. BSD license) makes it easier to decide to use it.

Re:Zstandard v1.3.4 – faster everything by terrelln on Friday March 30, 2018 @03:42PM (#16719194)
It is mentioned at the bottom of the README, but it isn't very findable. I've opened a PR https://github.com/facebook/zstd/pull/1085.
Re:Zstandard v1.3.4 – faster everything by exikyut on Friday March 30, 2018 @09:46PM (#16721185)
Which got accepted (an hour after you submitted it) - nice!
Re:Zstandard v1.3.4 – faster everything by eridius on Friday March 30, 2018 @03:44PM (#16719211)
Dual-licensed means buyer's choice. As the client of the library, you can use it under the terms of either license.
Re:Zstandard v1.3.4 – faster everything by cbuq on Friday March 30, 2018 @03:04PM (#16718872)
The whole patent issue was the BSD + Patents license Facebook used (they addressed the concerns over React by relicensing to MIT and dropping the PATENTS file).

The PATENTS file appears to be present in zstd 1.3.0 but not 1.3.1, so it looks like similar actions have been carried over here?

I'm left with questions though, because the development branch has both a LICENSE file (BSD) and a COPYING file (GPL).

Re:Zstandard v1.3.4 – faster everything by ntoshev on Saturday March 31, 2018 @05:47AM (#16722593)
I'd like to be able to load log files in a database and have it take the same space as compressed log file size, not the uncompressed size (which can easily be 20x more). I guess this requires database built on compact data structures or something similar, but surely simple support for dictionary compression for database text fields would help? Text fields are small chunks of text of the same type, so they should be amenable to good compression with the same dictionary. I've searched around and found some support in RocksDB, but that's pretty much it.

Most compression libraries offer dictionary support, although it's somewhat obscure. For example, there is no method in zlib to actually create your dictionary. Bindings and higher level libraries often ignore the dictionary support.