on master help sign in
Add performance notes for recordSyntaxWithHeader in Serialize.TH
commit11f5c997c21ba50eb7f1b73cde9d5360f8431c46 authorAdithya Kumar <adithya@composewell.com> dateFri 15 Sep 2023, 01:25 (3 years ago) parentc6fa580
1 file changed+14−1
core/src/Streamly/Internal/Data/Serialize/TH/Bottom.hs+14−1
core/src/Streamly/Internal/Data/Serialize/TH/Bottom.hs+14−1
@@ -83,7 +83,20 @@ data Config =
8383 -- ^ __Experimental__
8484 --
8585 -- 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"]@
87100 }
88101
89102defaultConfig :: Config