Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

Resolves #4126.

When constructing extremely large layers performance can be negatively impacted because layers are used as keys in the MemoMap and the hash codes of layers are recomputed each time, which can require having to recursively compute the hash codes of all layers composed into the layer. With this PR we store the hash code of a layer once it has been computed to avoid this, resulting in dramatic improvements in time to construct complex layers (from ~3seconds to ~200ms for me locally using the example from the original issue).

@adamgfraser adamgfraser merged commit 86f2963 into zio:master Sep 29, 2020
@adamgfraser adamgfraser deleted the 4126 branch September 29, 2020 17:51
dkarlinsky added a commit to dkarlinsky/zio that referenced this pull request Oct 30, 2021
* FiberRef.locally doesn't reset to initial value
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.

ZLayer constructed with >+> takes exponential time to build

3 participants