on master help sign in
Add performance notes for recordSyntaxWithHeader in Serialize.TH
11f5c99Adithya Kumar
core/src/Streamly/Internal/Data/Serialize/TH/Bottom.hs+14−1
@@ -83,7 +83,20 @@ data Config =
83 -- ^ __Experimental__
83 -- ^ __Experimental__
84 --
84 --
85 -- If True, encode the keys of the record as a header and then
85 -- If True, encode the keys of the record as a header and then
86− -- serialize the data.
86+ -- serialize the data. Multiple constructors are not supported with
87+ -- @recordSyntaxWithHeader@ enabled.
88+ --
89+ -- __Performance Notes:__
90+ --
91+ -- There is a constant regression proportional to
92+ -- @sum (map length keyList) + length keyList@ where @keyList@ is the
93+ -- list of keys of that record as strings.
94+ --
95+ -- As an example, @keyList@ of,
96+ -- @
97+ -- data RecordType = RecordType { field0 :: Int, field2 :: Char }
98+ -- @
99+ -- is @["field0", "field1"]@
87 }
100 }
88
101
89defaultConfig :: Config
102defaultConfig :: Config