Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance #63

Open
ccorcos opened this issue Oct 20, 2016 · 2 comments
Open

Performance #63

ccorcos opened this issue Oct 20, 2016 · 2 comments

Comments

@ccorcos
Copy link

ccorcos commented Oct 20, 2016

Doesn't this entirely destroy the laziness of React components?

https://github.com/salsita/redux-elm/blob/master/src/forwardTo.js#L14

I've come up with an interesting solution here:

https://github.com/ccorcos/elmish/blob/narrative/src/tutorial/7-lazy-react/index.js#L55-L63

Where I use shouldComponentUpdate to compare dispatch functions using a .equals function that remembers all the partially applied types...

@tomkis
Copy link
Collaborator

tomkis commented Oct 25, 2016

Yeah, forwardTo indeed returns a new reference.

However, I am not really fan of storing memoized function arguments in the function reference itself. I could imagine _.memoize could do the trick.

We have to decide how we want to handle this, because I do believe that this kind of performance optimization should be in user land.

@ccorcos
Copy link
Author

ccorcos commented Oct 25, 2016

_.memoize doesnt clean up though. you'll have a memory explosion.

@tomkis tomkis mentioned this issue Jan 20, 2017
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

No branches or pull requests

2 participants