aboutsummaryrefslogtreecommitdiff
path: root/lib/std/compress
AgeCommit message (Collapse)Author
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-06-11stage2: make `error{}` the same size as `anyerror`Veikka Tuominen
Having `error{}` be a zero bit type causes issues when it interracts with empty inferred error sets which are the same size as `anyerror`.
2022-06-11stage2: small fixes + adjustments to std testsVeikka Tuominen
2022-04-05zig fmt: remove trailing whitespace on doc commentsDamien Firmenich
Fixes #11353 The renderer treats comments and doc comments differently since doc comments are parsed into the Ast. This commit adds a check after getting the text for the doc comment and trims whitespace at the end before rendering. The `a = 0,` in the test is here to avoid a ParseError while parsing the test.
2022-01-29std: remove superfluous `.read = true` from deflate testsVeikka Tuominen
2022-01-23compress: add a deflate compressorHadrien Dorio
Replaces the inflate API from `inflateStream(reader: anytype, window_slice: []u8)` to `decompressor(allocator: mem.Allocator, reader: anytype, dictionary: ?[]const u8)` and `compressor(allocator: mem.Allocator, writer: anytype, options: CompressorOptions)`
2022-01-23compress: remove sha256 checks from testsHadrien Dorio
Read bytes to check expected values instead of reading and hashing them. Hashing is a waste of time when we can just read and compare. This also removes a dependency on std.crypto.hash.sha2.Sha256 for tests.
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-10-04Merge pull request #9880 from squeek502/deflate-construct-errorsAndrew Kelley
deflate: Better Huffman.construct errors and error handling
2021-10-04deflate.zig: check for distances past beginning of output streamMatthew Borkowski
2021-10-02deflate: Update fuzzed test cases and add InvalidTree test casesRyan Liptak
2021-10-01deflate: Better Huffman.construct errors and error handlingRyan Liptak
This brings construct error handling in line with puff.c
2021-09-28deflate.zig: fix bits_left overflow at EndOfStream and @intCast truncation ↵Matthew Borkowski
with empty Huffman table
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-05-20Run `zig fmt` on src/ and lib/std/Isaac Freund
This replaces callconv(.Inline) with the more idiomatic inline keyword.
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-05-03x/os, x/net: re-approach `Address`, rename namespace `TCP -> tcp`lithdew
Address comments from @ifreund and @MasterQ32 to address unsafeness and ergonomics of the `Address` API. Rename the `TCP` namespace to `tcp` as it does not contain any top-level fields. Fix missing reference to `sockaddr` which was identified by @kprotty in os/bits/linux/arm64.zig.
2021-04-29check for overflow when reading code lengths for a block with dynamic ↵Matthew Borkowski
Huffman codes
2021-02-10Convert inline fn to callconv(.Inline) everywhereTadeo Kondrak
2020-12-31Year++Frank Denis
2020-12-09small fixes and zig fmtVexu
2020-10-29std/deflate: Avoid reading past end of streamLemonBoy
Use a conservative (and slower) approach in the Huffman decoder fast path. Closes #6847
2020-09-11std: Add a gzip decoderLemonBoy
2020-09-11Re-enable a compression testLemonBoy
It somehow got commented out...
2020-09-11std: Make the DEFLATE decompression routine 3x fasterLemonBoy
A profiler run showed that the main bottleneck was the naive decoding of the Huffman codes, replacing it with a nice trick borrowed by Zlib gave a substantial speedup. Replacing a `%` with a `and (mask-1)` gave another significant improvement (yay for low hanging fruits). A few numbers obtained by decompressing a 22M file: Before: ``` ./decompress 2,39s user 0,00s system 99% cpu 2,400 total ``` After: ``` ./decompress 0,79s user 0,00s system 99% cpu 0,798 total ````
2020-09-08Zlib: Make deinit function publicTimon Kruiper
2020-09-07std: Add DEFLATE and zlib decompressorsLemonBoy