on master help sign in
Use strictness annotation on ring head pointer

The ring head Ptr was being allocated in the loop causing 16x allocations compared to when strictness annotation is used.

commita2a589e54ef4a981c06628f5bad08de4a936b74e authorHarendra Kumar <harendra@composewell.com> dateTue 27 Oct 2020, 18:18 (6 years ago) parent29ebe7e
1 file changed+4−4
src/Streamly/Internal/Data/Stream/StreamD.hs+4−4
src/Streamly/Internal/Data/Stream/StreamD.hs+4−4
@@ -1799,10 +1799,10 @@ data SplitOnState fs s a b w rb rh ck =
17991799 | GO_SHORT_PAT_NEXT_WITH !fs s a !w
18001800 | GO_SHORT_PAT_DRAIN Int !fs !w
18011801 -- | GO_SHORT_PAT_YIELD_SEP Int !fs s w -- Only for splitSuffixOn.
1802− | GO_KARP_RABIN_ACCUM Int s rb rh
1803− | GO_KARP_RABIN_NEXT !fs s rb rh !ck
1804− | GO_KARP_RABIN_NEXT_WITH !fs s a rb rh !ck
1805− | GO_KARP_RABIN_DRAIN Int !fs rb rh
1802+ | GO_KARP_RABIN_ACCUM Int s rb !rh
1803+ | GO_KARP_RABIN_NEXT !fs s rb !rh !ck
1804+ | GO_KARP_RABIN_NEXT_WITH !fs s a rb !rh !ck
1805+ | GO_KARP_RABIN_DRAIN Int !fs rb !rh
18061806 -- | GO_KARP_RABIN_YIELD_SEP Int !fs s rb rh -- Only for splitSuffixOn.
18071807 | GO_YIELD b (SplitOnState fs s a b w rb rh ck)
18081808 | GO_DONE