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

Document main performance considerations #93

Open
2 of 4 tasks
polytypic opened this issue May 19, 2017 · 2 comments
Open
2 of 4 tasks

Document main performance considerations #93

polytypic opened this issue May 19, 2017 · 2 comments

Comments

@polytypic
Copy link
Member

polytypic commented May 19, 2017

There should a section in the documentation that explains main performance considerations when using lenses.

  • Warn about reconstruction of optics in L.choose
  • Explain that nesting traversals doesn't materialize intermediate collections
  • Explain use of staging to avoid reconstructing optics
  • Explain use of L.toFunction to precompute compositions
@fiatjaf
Copy link

fiatjaf commented Jun 12, 2017

It seems to be recreating all objects down to the deeper nested path where a transformation occurs. Is that right? Is that the major source of performance concerns?

@polytypic
Copy link
Member Author

The recreation of objects down to where transformation occurs is intentional as the idea is to treat data structures as immutable and not to mutate any existing objects. So, yes that is right and there are certainly cases where use of immutable data structures can be a performance concern, but that is not the kind of performance consideration that this issue mostly about.

The idea with this issue is to document kinds of performance considerations where one might not realize that a particular way to use this library might lead to poor performance compared to some other way to use this library. There is already a section on performance tips, but it is not complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants