on master help sign in
Add a couple of useful/TODO comments
commit8adebe0c02e9394a88ceb910fed284d9c1cb9e78 authorHarendra Kumar <harendra@composewell.com> dateThu 25 Jan 2024, 00:37 (3 years ago) parent66507ff
2 files changed+11−1
core/src/Streamly/Internal/Data/MutByteArray/Type.hs+6 core/src/Streamly/Internal/Data/Serialize/TH.hs+5−1
core/src/Streamly/Internal/Data/MutByteArray/Type.hs+6
@@ -196,6 +196,12 @@ newBytesAs Pinned = pinnedNew
196196-- Copying
197197-------------------------------------------------------------------------------
198198
199+-- Note: Array copy is more efficient than streaming copy.
200+-- CopyMutableByteArray# translates to genMemcpy in GHC/CmmToAsm/X86/CodeGen.hs
201+-- glibc memcpy copies bytes/words/pages - unrolls the loops:
202+-- https://github.com/bminor/glibc/blob/4290aed05135ae4c0272006442d147f2155e70d7/string/memcpy.c
203+-- https://github.com/bminor/glibc/blob/4290aed05135ae4c0272006442d147f2155e70d7/string/wordcopy.c
204+
199205-- | Put a sub range of a source array into a subrange of a destination array.
200206-- This is not safe as it does not check the bounds of neither the src array
201207-- nor the destination array.
core/src/Streamly/Internal/Data/Serialize/TH.hs+5−1
@@ -7,7 +7,11 @@
77-- Maintainer : streamly@composewell.com
88-- Stability : experimental
99-- Portability : GHC
10−--
10+
11+-- XXX Instead of applying the product constructor in one go can we apply it
12+-- one at a time in case of too many arguments, compiler may not have to save
13+-- them in local vars.
14+
1115module Streamly.Internal.Data.Serialize.TH
1216 (
1317 -- Deriving