HackerTrans
TopNewTrendsCommentsPastAskShowJobs

klauspost

101 karmajoined 12 lat temu
http://blog.klauspost.com/ https://twitter.com/sh0dan https://github.com/klauspost

Submissions

Minlz v1.2: Search compressed data with without decompression

github.com
1 points·by klauspost·3 dni temu·1 comments

MinLZ: Efficient and fast Snappy/LZ4 style compressor in Go (Apache 2.0)

github.com
18 points·by klauspost·w zeszłym roku·4 comments

AIStor: The Most Powerful Version of MinIO

blog.min.io
12 points·by klauspost·2 lata temu·5 comments

Rapidgzip – Parallel Decompression and Seeking in Gzip (Knespel, Brunst – 2023) [pdf]

github.com
4 points·by klauspost·3 lata temu·2 comments

Go Implementation of Leopard-RS GF16

github.com
1 points·by klauspost·4 lata temu·1 comments

comments

klauspost
·3 dni temu·discuss
Available via cli and Go API
klauspost
·4 miesiące temu·discuss
https://github.com/klauspost/stdgozstd
klauspost
·4 miesiące temu·discuss
About the versioning, glad you spotted it anyway. There isn't as much use of the gzhttp package compared to the other ones, so the bar is a bit higher for that one.

Also making good progress on getting a slimmer version of zstd into the stdlib and improving the stdlib deflate.
klauspost
·w zeszłym roku·discuss
The main reason I took the effort to write the spec was to encourage ports - and commit to the format.

I've converted a basic block encoder/decoder to C (see end of README for link), to assist anyone wanting to get started on a C implementation.

Having been 10+ years since I've done any serious C, I didn't want to assume I could write a good C API for it.

If anyone are interested in picking it up, reach out.

> comparisons with zstd & lz4

The repo has lz4 comparisons (Go version) for both blocks and streams.

I see MinLZ more like a compliment to zstd, just like lz4 - where speed matter more than ultimate size.

Here is the fully parallel speed of block decompressing with zstd or minlz - Go versions:

* Protobuf - zstd: 31,597 MB/s - MinLZ 155,804 MB/s. * HTML - zstd: 25,157 MB/s - MinLZ 82,292 MB/s. * URL List - zstd: 16,869 MB/s - MinLZ 45,521 MB/s. * GEO data - zstd: 11,837 MB/s - MinLZ 36,566 MB/s.

Of course zstd compresses to a smaller size - but for things like streams transfers or for fast readbacks from disk you probably want the fastest.

Overall, I would say that MinLZ is about 2x faster decompressing, and compresses about 2x the speed compressing at max speed. But of course with less compression.
klauspost
·w zeszłym roku·discuss
Writeup on design and changes: https://gist.github.com/klauspost/a25b66198cdbdf7b5b224f670c...

Block and Stream Format: https://raw.githubusercontent.com/minio/minlz/refs/heads/mai...
klauspost
·w zeszłym roku·discuss
I just released about 2 years of work on improving compression with a fixed encoding LZ77 style compressor.

Our goal was to improve compression by combining and tweaking the best aspects of LZ4 and Snappy.

The package provides Block (up to 8MB) and Stream Compression. Both compression and decompression have amd64 assembly that provides speeds of multiple GB - typical at memory throughput limits. But even the pure Go versions outperform the alternatives.

Full specification available.
klauspost
·2 lata temu·discuss
In my experience, the hybrid approach is practically better due to cache locality anyway, so I don't think even native GF16 or GF32 would be of much help.

FWIW, I've ported rs-leopard to Go and found it very effective, except in the "recover one" scenario, where it is only at 50% speed of the "recover all" scenario, since it has to do several reconstructions to get one output. But even so, I am not too sure it would be much better with plain GF16, since you would still need to touch most shards to get one shard out.
klauspost
·2 lata temu·discuss
Almost all (x86) CPUs sold have GFNI. That can pretty much saturate memory bandwidth on a single core or two. You can use SSSE3 pshufb for the rest which is about half the speed.

ARM has NEON and SVE/SVE 2. They also operate very fast.

So not sure what you are thinking of.
klauspost
·2 lata temu·discuss
Looking at it quickly, it seems like you just moving entropy to the frequency table.

If the frequency table isn't included in the count, I could just make an "infinite" compressor by storing the frequency and cut one byte off the end. From the frequency table I could then deduce what the last byte should be.

> typical entropy encoders (Huffman, ANS, etc) would require 1 bit per symbol,

No. ANS (and range/arithmetic coding) allows for probabilities to be stored with fractional bits.
klauspost
·2 lata temu·discuss
> If I could change one thing about S3's API I would like an option to read the metadata with the listings.

Agree. In MinIO (disclaimer: I work there) we added a "secret" parameter (metadata=true) to include metadata and tags in listings if the user has the appropriate permissions. Of course it being an extension it is not really something that you can reliably use. But rclone can of course always try it and use it if available :)

> You can create zero length files ending in /

Yeah. Though you could also consider "shared prefixes" in listings as directories by itself. That of course makes directories "stateless" and unable to exist if there are no objects in there - which has pros and cons.

> Or alternatively a way of setting the Last-Modified on an object when you upload it would do too.

Yes, that gives severe limitations to clients. However it does make the "server" time the reference. But we have to deal with the same limitation for client side replication/mirroring.

My personal biggest complaint is that there isn't a `HeadObjectVersions` that returns version information for a single object. `ListObjectVersions` is always going to be a "cluster-wide" operation, since you cannot know if the given prefix is actually a prefix or an object key. AWS recently added "GetObjectAttributes" - but it doesn't add version information, which would have fit in nicely there.
klauspost
·3 lata temu·discuss
Repo: https://github.com/mxmlnkn/rapidgzip

As someone who has dabbled quite a lot with deflate this was a very interesting find. It seems like the format that never wants to die.

First of all I am surprised this is even possible. Given the extremely minimal and non-aligned nature of the deflate headers, I actually discarded this as being feasible, with the false positive rate likely being too high.

The paper and implementation is an amazing piece of engineering. Hats off to the author. With an index, you are in "easy" mode, so I consider the unindexed "hard mode" the big accomplishment.

I am still digesting it. So if I read the paper correctly the false positive rate is approximately 1 for every 5GB. Very reasonable.
klauspost
·3 lata temu·discuss
Last I checked QAT was limited to 64KB backreferences and independent 128KB blocks.

Now you know why they are comparing 16KB payloads only.
klauspost
·3 lata temu·discuss
.. for small payloads.

QAT cannot compress across blocks. So as soon as your input is more than 128KB the compression ratio tanks.

Usually well below what even level 1 of software zstd does. They choose the input very carefully.
klauspost
·3 lata temu·discuss
This could be very useful for a project I am just starting on.

No documentation, and example has no content makes the learning curve a bit steep.

Does anyone have any pointers on how to use this?
klauspost
·4 lata temu·discuss
Reading it, it seems very similar to the Playstation 3 Cell, with its fate mirroring it very much.

A highly specialized processor that has very high computational throughput for specialized operations, but a quite limited scalar unit.

In both cases you really have to write software specifically for it to get it to perform with any reasonable speed. If you do that, you get great value, but any existing code will need significant modifications to perform.

Granted AVX512 is (now) more common than SPE code ever became. It is slightly better than the Itanium approach, but scalar performance (especially single threaded) will have limited the value you get from this CPU, unless you write your own software and it can utilize AVX-512.
klauspost
·4 lata temu·discuss
You can use presigned urls for that.
klauspost
·4 lata temu·discuss
Leopard-RS GF16 support added to reedsolomon package, with SSE3, AVX2 and AVX512 assembly.

This allows to encode up to 65536 data+parity shards at O(K Log M), where K is the original data size, and M is up to twice the size of the recovery set.
klauspost
·4 lata temu·discuss
> If you see a match that would not be visible from given compression level[...]

Yes, but you'd need to reconstruct the hash table and the link table. For that you'd need to decompress fully. You could compare matches, but you are so far along at this point you might as well just decompress and recompress, comparing the output bit by bit.
klauspost
·4 lata temu·discuss
There is no way to "rule some levels out". The levels only differ in the quality of the lz matches. Slower levels search further potential matches - you cannot see that from a compressed stream.

You can compare the output from each level and that will be your guess, assuming of course that zlib was used in the first place.
klauspost
·4 lata temu·discuss
A block can end at any time and another huffman block with another table can start. There is no way to know that without decoding all symbols.

Decoding the huffman codes is by far the most expensive operation, so you don't save much.

For decoding match lengths you also need to decode all symbols.