Skip to content

Conversation

@thomashoneyman
Copy link
Member

This PR adds examples for the lazy and memoized functions. The example works by displaying three results of calling a very poor fibonnaci implementation, with an extra button to toggle the background color of the example. Toggling the background color without memoization leads to extremely slow renders.

The first example re-renders any time the state changes, like normal Halogen, and it's quite slow. The second example uses memoized with eq, and it's quite slow because of #742 (but is fixed in #743). The third example uses lazy and is quite fast.

Here's a demonstration of this example running against master:

master.mov

Notably, the memoized example is still very slow. But if I run this example against the fix-memoized branch used in #743 the result is what we'd expect:

fix-memoized.mov

@thomashoneyman thomashoneyman mentioned this pull request Apr 9, 2021
@thomashoneyman thomashoneyman merged commit d424510 into purescript-halogen:master Apr 15, 2021
@thomashoneyman thomashoneyman deleted the memoized-example branch April 15, 2021 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants