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

cache() with capacity hint overload #1303

Closed
benjchristensen opened this issue Jun 1, 2014 · 3 comments
Closed

cache() with capacity hint overload #1303

benjchristensen opened this issue Jun 1, 2014 · 3 comments

Comments

@benjchristensen
Copy link
Member

Provide a cache(int capacity) overload that acts as a hint for memory allocation.

Ideally it should also allow for an optimization with ReplaySubject when the capacity is 1 so it can use a simple object reference to store the single value and not allocate an array. If more than 1 is received then it would obviously have to switch to using an array, but there are many case, such as Hystrix that would benefit from this change.

@gliptak
Copy link
Contributor

gliptak commented Jun 26, 2014

I'm not sure how to approach changingUnboundedReplayState/ReplayState as both complete() and error() methods will "force" to change from single value to array ...

@gliptak
Copy link
Contributor

gliptak commented Jun 27, 2014

I missed the discussion with @jbripley #1338

@benjchristensen
Copy link
Member Author

This is done good enough for now as of #1393 which was merged.

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