lzlib 0.3.0.0 → 0.3.0.1
raw patch · 6 files changed
+28/−7 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- README.md +12/−1
- bench/Bench.hs +6/−2
- lzlib.cabal +2/−2
- src/Codec/Lzip.hs +3/−1
- stack.yaml +1/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # lzlib +## 0.3.0.1++ * Performance improvements+ ## 0.3.0.0 * Take a `BSL.ByteString` as input
README.md view
@@ -6,12 +6,23 @@ Haskell bindings to [lzlib](https://www.nongnu.org/lzip/lzlib.html). +This package includes a high-level interface to lzlib, however, it is slow.+ ## Hacking Run ```bash-./bash/setup+make -j ``` to download a few tarballs before running the test suite.++### CI++To edit the CI script, edit `haskell-ci.dhall` and regenerate+`.github/workflows/haskell.yml` with++```+make ci+```
bench/Bench.hs view
@@ -31,9 +31,11 @@ ] , bgroup "unpack" [ bench "lzlib" $ nfIO unpack ]- , env decompressed $ \f ->+ , env decompressedFiles $ \ ~(f, g) -> bgroup "roundtrip'"- [ bench "lzlib" $ nf roundtrip' f ]+ [ bench "lzlib (lzlib)" $ nf roundtrip' f+ , bench "lzlib (gmp)" $ nf roundtrip' g+ ] , bgroup "unpack" [ bench "lzlib" $ nfIO unpack' ] ]@@ -41,3 +43,5 @@ bigFile = BSL.readFile "gmp-6.1.2.tar.lz" files = (,) <$> file <*> bigFile decompressed = BSL.readFile "lzlib-1.10.tar"+ bigDecompressed = BSL.readFile "gmp-6.1.2.tar"+ decompressedFiles = (,) <$> decompressed <*> bigDecompressed
lzlib.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: lzlib-version: 0.3.0.0+version: 0.3.0.1 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2019 Vanessa McHale@@ -45,7 +45,7 @@ Codec.Lzip Codec.Lzip.Raw - cc-options: -O1+ cc-options: -O3 c-sources: cbits/lzlib.c hs-source-dirs: src default-language: Haskell2010
src/Codec/Lzip.hs view
@@ -58,6 +58,8 @@ maxSz <- lZDecompressWriteSize decoder let bss = BSL.toChunks bs+ -- TODO: this might be silly: does it force everything into memory+ -- prematurely? sz = maximum (BS.length <$> bss) bufMax = fromIntegral maxSz @@ -73,7 +75,7 @@ loop :: LZDecoderPtr -> [BS.ByteString] -> Int -> (Ptr UInt8, Int) -> [BS.ByteString] -> IO [BS.ByteString] loop decoder bss maxSz (buf, bufSz) !acc = do bss' <- case bss of- [bs'] -> if BS.length bs' > maxSz + [bs'] -> if BS.length bs' > maxSz then do let (bs'', rest) = BS.splitAt maxSz bs' BS.useAsCStringLen bs'' $ \(bytes, sz) ->
stack.yaml view
@@ -1,5 +1,5 @@ ----resolver: lts-14.7+resolver: lts-14.16 ghc-options: {"$locals": -ddump-to-file -ddump-hi} packages: - '.'