You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this should go in its own Appendix. Or perhaps be a new folder?
It would be nice if a guide was written that explained various tips/tricks for maximizing performance when it's needed most. A few examples that immediately come to mind:
Reduce the number of traversals where possible
For example, map f <<< map g (2 traversals) should become map (f <<< g) (1 traversal). This tends to sneak in when some code is using foldl/foldr implicitly.
Split multi-case statements into optimized trees
For example, the below code will be highly readable, but comes at a performance cost.
foo = case _, _, _ of
....
This code is more performant due to resulting JS code that gets generated.
foo a b c = case a of
... -> case b of
... -> case c of
... -> ...
The text was updated successfully, but these errors were encountered:
I think this should go in its own Appendix. Or perhaps be a new folder?
It would be nice if a guide was written that explained various tips/tricks for maximizing performance when it's needed most. A few examples that immediately come to mind:
Reduce the number of traversals where possible
For example,
map f <<< map g
(2 traversals) should becomemap (f <<< g)
(1 traversal). This tends to sneak in when some code is usingfoldl
/foldr
implicitly.Split multi-case statements into optimized trees
For example, the below code will be highly readable, but comes at a performance cost.
This code is more performant due to resulting JS code that gets generated.
The text was updated successfully, but these errors were encountered: