Repository navigation
chore(deps): update module github.com/pierrec/lz4/v4 to v4.1.35 - #305
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v4.1.34→v4.1.35Release Notes
pierrec/lz4 (github.com/pierrec/lz4/v4)
v4.1.35Compare Source
Added
one, with examples for
CompressBlockWithDictandDictionaryOption.In CI, the
lz4command and this package decode each other's framescompressed with a dictionary; a fuzzer in
benchchecks blocks againstliblz4 (#310).
DictionaryOptionworks with
FastandLevel1toLevel9, andCompressorHCgainsCompressBlockWithDict. Compressing pg1661.txt after its first 64 KiB, in64 KiB blocks with those 64 KiB as the dictionary,
Level9output shrinksfrom 52.0% to 45.3% of the input (#313).
DictionaryIDOptionsets the ID of the dictionary:WriterandCompressingReaderwrite it in the frame descriptor, as the C library doeswhen its
dictIDpreference is set, and aReaderrefuses a frame withanother ID with
ErrInvalidFrameDescriptor, as decoding with the wrongdictionary produces garbage that only a content checksum would catch.
WriterandCompressingReaderreturnErrOptionNotApplicablefor an IDwithout a dictionary (#314, #319).
CompressorCCompatHCand the levelsCCompatLevel2toCCompatLevel12port the C library's
LZ4_compress_HCand produce the same blocks at eachof its levels: level 2 (
lz4mid), the hash chain with lookahead of levels3 to 9, and the optimal parser of levels 10 to 12. Unlike
Level1toLevel9, which differ in search depth only and give almost the sameoutput, they trade speed for ratio as C's levels do. Set
CompressorCCompatHC.Levelto one of them; it refusesLevel1toLevel9. InCompressorHC.Level, they would be search depths of 2 to 12(#219, #312, #320).
LICENSE-lz4holds the BSD 2-Clause License of the C library, whose codeCompressorCCompatandCompressorCCompatHCport; the ported files and theREADME name it. Programs distributed in binary form should reproduce it
with this package's license (#312).
Changed
Writercompresses blockswith a dictionary concurrently, writing the same frame as without
concurrency, and
Readerdecodes independent blocks with one concurrently.With
ConcurrencyOptionabove 1, aWriterwith a dictionary now behavesas one without: it calls the
OnBlockDoneOptionhandler from severalgoroutines, so the handler must be safe for concurrent use, and it reports
an error from the destination at
Closerather than at theWritethatproduced the block (#311).
CompressionLevelOptionaccepts 2 to 12, asCCompatLevel2toCCompatLevel12;CompressionLevel(2)toCompressionLevel(12)failedwith
ErrOptionInvalidCompressionLevel, and now select the C library'slevels, which are slower at the top: level 12 is its optimal parser (#312).
Readerdecodes frames with linked blocks, such aslz4 -BDwrites, withoutallocating: it keeps the last 64 KiB of output instead of copying every block
into a new buffer. Decoding the Silesia corpus is about 30% faster from
64 KiB blocks and 13% faster from 4 MiB blocks on a Zen 3 core (#308).
Silesia corpus takes 5-6% less time on an Intel Xeon 6975P-C (Granite
Rapids) and 2-4% less on a Zen 3 core (#322, #323).
Fixed
WriterandCompressingReaderkeep the size fromSizeOptionwhen theyreset, as they keep the other options. They kept the size flag but cleared
the size, which broke three common uses: a later
Applycall, which resetsfirst;
ResetafterApply, as afterNewWriter(nil); and a second frame.Closefailed withErrInvalidContentSize; before v4.1.31, such frames werewritten with a content size of 0 (#317).
Readertreats a declared content size of 0 as unknown, as the C librarydoes, so it reads those frames again; since v4.1.31 it rejected them with
ErrInvalidContentSize(#317).ReaderwithDictionaryOptiondecodes frames whose descriptor holds adictionary ID, as the C library writes when its
dictIDpreference is set;it rejected them with
ErrInvalidFrameDescriptoreven with the rightdictionary. Without a dictionary it still rejects them, and
ValidFrameHeadernow accepts such headers (#314).Writerfails after a failedFlushuntilReset, as after a failedWrite. Without concurrency, a laterWritesucceeded andClosewrotethe block again, which corrupts the frame if the destination took part of
it, and returned nil if that write succeeded.
FlushandCloseon azero-value
WriterreturnErrInternalUnhandledState;Closepanicked(#321).
WriteratCCompatFastor aCCompatLevelstores a block raw unless itcompresses to less than its size, as the C library's frame encoder does. A
block that compressed to exactly its size was written compressed, so such
frames could differ from the
lz4command's; atCCompatFastsincev4.1.31 (#324).
(
-buildmode=pluginand-buildmode=sharedon linux/amd64); since v4.1.32the build failed with
R15 is clobbered by a global variable access. CI nowbuilds the module with
-dynlink(#305).lz4cThese ship in
cmd/lz4cv1.1.0, which follows this tag.compress -D filecompresses with a dictionary, anduncompress -D filedecompresses with it, as with the C
lz4command.-Dworks with-l 0to
-l 9; with-ccompatit fails, as the C-compatible levels take nodictionary (#315, #324).
compress -ccompat -l Ncompresses each block as the Clz4tool does atlevel N, from 1 to 12 (
CCompatFastandCCompatLevel2toCCompatLevel12). Without-ccompat,-lis unchanged (#316).lz4crequires Go 1.27; the library still requires Go 1.22. CI runs itstests, and tests the library on Go 1.22 and with the
nounsafetag (#309).compress -scsaid that it disables the stream checksum; theflag has always enabled it, and the help now says so. Without
-sc, framesstill have no stream checksum (#302).
Internal
cmd/lz4c/BUMPfile containingminormakes the nextlz4crelease aminor version rather than a patch, and the release commit deletes it;
cmd/lz4c/release.sh -nextprints the version the next release will tag(#325).
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.