on develop help sign in
Improve inlining of cacheEvent, fanInt, and mergeIntIncremental
commit7c62738b7844b962006755a1d90b7c045841cd4e authorRyan Trinkle <ryan.trinkle@gmail.com> dateFri 1 Sep 2017, 14:21 (9 years ago) parent02dc78c
1 file changed+3−1
src/Reflex/Spider/Internal.hs+3−1
src/Reflex/Spider/Internal.hs+3−1
@@ -266,7 +266,7 @@ data CacheSubscribed x a
266266--TODO: Try a caching strategy where we subscribe directly to the parent when
267267--there's only one subscriber, and then build our own FastWeakBag only when a second
268268--subscriber joins
269−{-# NOINLINE cacheEvent #-}
269+{-# NOINLINE [0] cacheEvent #-}
270270cacheEvent :: forall x a. HasSpiderTimeline x => Event x a -> Event x a
271271cacheEvent e =
272272#ifdef DEBUG_TRACE_EVENTS
@@ -2330,7 +2330,9 @@ instance HasSpiderTimeline x => R.Reflex (SpiderTimeline x) where
23302330 eventCoercion Coercion = Coercion
23312331 behaviorCoercion Coercion = Coercion
23322332 dynamicCoercion = unsafeCoerce --TODO: How can we avoid this unsafeCoerce? This is safe only because we know how Identity works as a Patch instance
2333+ {-# INLINABLE mergeIntIncremental #-}
23332334 mergeIntIncremental = SpiderEvent . mergeInt . (unsafeCoerce :: Dynamic x (PatchIntMap (R.Event (SpiderTimeline x) a)) -> Dynamic x (PatchIntMap (Event x a))) . unSpiderIncremental
2335+ {-# INLINABLE fanInt #-}
23342336 fanInt e = R.EventSelectorInt $ SpiderEvent . selectInt (fanInt (unSpiderEvent e))
23352337#endif
23362338