, , ByteString binary ( cereal, , / ). Builder, , , 32 . , , , , , 8 .
binary , - :
encodeInt64 :: Int64 -> B.ByteString
encodeInt64 x =
let
go :: Int -> Maybe (Word8, Int)
go i
| i < 0 = Nothing
| otherwise =
let
w :: Word8
w = fromIntegral (x `shiftR` i)
in Just (w, i-8)
in fst $ B.unfoldrN 8 go 56
, , .
, Data.Set, Data.HashSet unordered-containers.
, , , -A200M ( -abouts).
( , Data.HashSet -A200M), 7.397s 3.474s , GC GC 52.9% 21.2 % .
, Big-O , , !