Skip to content

Add a PureScript Performance Guide #591

@JordanMartinez

Description

@JordanMartinez

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
     ... -> ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design-PatternsSomething related to the Design Patterns folder in this repoenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions