on master help sign in
Add INLINE pragma on Serialize instances
52ddfeeHarendra Kumar
core/src/Streamly/Internal/Data/Serialize.hs+3
@@ -102,11 +102,14 @@ class Serialize a where
102
102
103#define DERIVE_SERIALIZE_FROM_UNBOX(_type) \
103#define DERIVE_SERIALIZE_FROM_UNBOX(_type) \
104instance Serialize _type where \
104instance Serialize _type where \
105+; {-# INLINE size #-} \
105; size = ConstSize $ Unbox.sizeOf (Proxy :: Proxy _type) \
106; size = ConstSize $ Unbox.sizeOf (Proxy :: Proxy _type) \
107+; {-# INLINE deserialize #-} \
106; deserialize off arr = \
108; deserialize off arr = \
107 Unbox.peekByteIndex off arr >>= \
109 Unbox.peekByteIndex off arr >>= \
108 \val -> let sz = Unbox.sizeOf (Proxy :: Proxy _type) \
110 \val -> let sz = Unbox.sizeOf (Proxy :: Proxy _type) \
109 in pure (off + sz, val) \
111 in pure (off + sz, val) \
112+; {-# INLINE serialize #-} \
110; serialize off arr val = \
113; serialize off arr val = \
111 Unbox.pokeByteIndex off arr val \
114 Unbox.pokeByteIndex off arr val \
112 >> let sz = Unbox.sizeOf (Proxy :: Proxy _type) \
115 >> let sz = Unbox.sizeOf (Proxy :: Proxy _type) \