Commit Graph
93 Commits
Author SHA1 Message Date
Nigel Tao eac65a0084 Fix lib/raczlib build for CGO_ENABLED=0 2019-09-14 10:26:15 +10:00
Nigel Tao 8d408c7c2c Add a Close method to rac.Codec{Reader,Writer} 2019-09-10 09:19:01 +10:00
Nigel Tao fed2073b00 Have lib/raczlib use lib/cgozlib
As the cmd/ractool comment changes say, this is almost a 2x speed-up for
RAC+Zlib decoding on the enwik8 test file, comparable to the cgozlib
benchmark numbers:

$ go test -test.bench=. github.com/google/wuffs/lib/cgozlib
goos: linux
goarch: amd64
pkg: github.com/google/wuffs/lib/cgozlib
BenchmarkCgo-56     	    2514	    477230 ns/op
BenchmarkPure-56    	    1090	   1080853 ns/op
2019-09-07 11:35:48 +10:00
Nigel Tao 0f89b06207 Rename RAC's Zstandard Short Codec value
The bits in the byte no longer need to be independent. We can enumerate
0, 1, 2, etc instead of 1<<0, 1<<1, 1<<2, etc.
2019-09-07 11:23:52 +10:00
Nigel Tao 84878498ef Replace RAC's Brotli Short Codec value by LZ4
RAC still supports Brotli (as a Long Codec, not a Short Codec). It's
just no longer given a dedicated Short Codec value (and therefore less
likely to be supported out-of-the-box by cmd/ractool). Brotli occupies a
similar position to Zstandard on the speed versus size frontier. LZ4
occupies a noticably different position, faster but larger.
2019-09-07 11:19:10 +10:00
Nigel Tao 4006157f9f Re-do RAC codec values, from 8 bits to 56 bits 2019-09-07 10:25:33 +10:00
Nigel Tao e7c7e7bcf9 Have rac low-level test use a different fake Codec 2019-09-07 08:17:07 +10:00
Nigel Tao 7955ae50d1 Add cgozlib stubs to build when CGO_ENABLED=0 2019-09-07 08:10:16 +10:00
Nigel Tao a93d5a8ea7 Add a lib/cgozlib package 2019-09-01 22:48:56 +10:00
Nigel Tao 1fa39758cf Add a rac.CodecWriter.CanCut method 2019-09-01 15:37:21 +10:00
Nigel Tao 0a31851d85 Tweak how rac.concReader.Read moves to next work 2019-09-01 15:19:09 +10:00
Nigel Tao cb40bbc26c Simplify rac.concReader.nextWork 2019-09-01 15:11:04 +10:00
Nigel Tao c3f45a7aed Limit rac concurrent reader buffer sizes 2019-09-01 15:09:56 +10:00
Nigel Tao b8cd560594 Add a rac.Reader.SeekRange method 2019-08-31 22:19:54 +10:00
Nigel Tao 7753d147b7 Move RAC concurrent decode from program to library 2019-08-31 17:14:28 +10:00
Nigel Tao e0d9749f4e Add a rac.Reader.Close method 2019-08-31 10:43:18 +10:00
Nigel Tao 22c030b2e0 Have ractool decode in parallel
The "middle of the decompressed file" numbers changed because the
programs were re-run on a desktop, not a laptop.
2019-08-24 12:59:49 +10:00
Nigel Tao ca4a6c8846 Restore rac's CompressedSize to avoid Seek calls 2019-08-24 09:34:12 +10:00
Nigel Tao 9394364a47 Have rac favor io.ReaderAt over io.ReadSeeker 2019-08-24 07:56:34 +10:00
Nigel Tao 62211056f8 Fix "if false" debugging left in rac's readAt 2019-08-24 07:04:11 +10:00
Nigel Tao 31bdd08ce6 Re-order rac.Writer fields 2019-08-24 07:02:24 +10:00
Nigel Tao 7a82d135ff Rename rac.Parser as rac.ChunkReader 2019-08-17 17:59:47 +10:00
Nigel Tao d88fe767fe Delete some unused lib/rac test code 2019-08-09 21:49:17 +10:00
Nigel Tao 88220a7591 Add "RAC + Zeroes" codec 2019-08-09 21:46:28 +10:00
Nigel Tao 08798669eb Remove unnecessary rac CompressedSize field 2019-08-09 15:31:03 +10:00
Nigel Tao a61d735d54 Re-order rac.ChunkWriter.AddChunk args 2019-08-09 15:21:44 +10:00
Nigel Tao 706e7a2474 Encode RAC implicit zeroes when CChunkSize set 2019-08-09 15:10:43 +10:00
Nigel Tao ac4fed2275 Let rac.Writer support shared resources 2019-08-09 13:33:09 +10:00
Nigel Tao 685cf410bd Consolidate lib/rac's error messages 2019-08-08 16:05:58 +10:00
Nigel Tao 46a14c25f5 Rename the rac.Writer.chunkWriter private field 2019-08-08 15:49:52 +10:00
Nigel Tao 4fd8ead21f Have zlibcut example use log.Fatalf 2019-08-08 15:46:50 +10:00
Nigel Tao d070c6ad47 Merge some small lib/raczlib/*.go files 2019-08-08 15:44:01 +10:00
Nigel Tao 31eb600ad3 Remove unused raczlib constants 2019-08-08 15:41:00 +10:00
Nigel Tao 4d2f575f2a Refactor raczlib.Writer as rac part + zlib part 2019-08-08 15:38:21 +10:00
Nigel Tao 7d71bc590b Add rac.Reader.CodecReaders doc comment 2019-08-08 14:46:15 +10:00
Nigel Tao fe2b4e236d Make the rac codec per-chunk, not per-chunkWriter 2019-08-08 14:39:18 +10:00
Nigel Tao 2f1d6c77c9 Remove obsolete rac.ReaderContext comment 2019-08-08 14:21:21 +10:00
Nigel Tao 3c8ecf0627 Rename lib/rac's writer.go to chunk_writer.go 2019-08-08 14:16:32 +10:00
Nigel Tao a932033d6b Improve error msg for no matching rac.CodecReader 2019-08-08 12:37:07 +10:00
Nigel Tao 05267a2edc Rename rac.Writer as rac.ChunkWriter 2019-08-08 12:20:40 +10:00
Nigel Tao b7b4e308ba Refactor rac io.EOF / io.ErrUnexpectedEOF checks 2019-08-08 12:13:06 +10:00
Nigel Tao f4abc0ffe4 Invalidate raczlib cache if re-using its memory 2019-08-08 12:10:40 +10:00
Nigel Tao cdf49196b1 Add a rac.CodecReader abstraction 2019-08-08 12:09:25 +10:00
Nigel Tao 6b40d3ede1 Fix rac.Reader seeking inside the implicit zeroes 2019-08-06 20:20:51 +10:00
Nigel Tao db407e37c6 Fix rac IndexLocationAtEnd for deep index trees 2019-08-06 18:38:50 +10:00
Nigel Tao c5c32d62b6 Refactor raczlib.Reader as rac part + zlib part 2019-08-06 15:28:54 +10:00
Nigel Tao a8082bf301 Rename rac.Reader to rac.Parser 2019-08-06 15:25:44 +10:00
Nigel Tao 5c16eac8bb Rename lib/rac's reader.go to parser.go 2019-08-06 13:28:47 +10:00
Nigel Tao 93870d0d1d Prepare to generalize a raczlib.Reader 2019-08-06 11:40:58 +10:00
Nigel Tao f4919ad565 Add {lang,lib}/README.md 2019-08-06 10:57:30 +10:00