benchmark, test suite, and run length encoding
This commit is contained in:
parent
2123636291
commit
da83f9a5d0
19 changed files with 884 additions and 364 deletions
15
bench/Bench.hs
Normal file
15
bench/Bench.hs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Criterion.Main
|
||||
import Compress.LengthDistancePairs
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Compress.Arithmetic as A
|
||||
|
||||
main = do
|
||||
testData <- BS.unpack . BS.take 10000 <$> (BS.readFile "pg64317.txt")
|
||||
defaultMain [
|
||||
bgroup "encode" [
|
||||
bench "length distance pair" $ nf (encode :: [Word8] -> [LengthDistancePair Word32]) testData
|
||||
],
|
||||
bgroup "arithmetic coding" [
|
||||
bench "pg64317.txt" $ nf A.compress testData
|
||||
]
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue