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

Reduce Ring Buffer Default Sizes (and lower for Android) #1836

Merged
merged 2 commits into from
Nov 8, 2014

Conversation

benjchristensen
Copy link
Member

  • This adds platform dependent checks to lower the buffer sizes on Android to use less memory. It also reduces the normal defaults as perf testing showed we didn't need to be as high.
  • This adds System properties for overriding the defaults, rx.ring-buffer.size and rx.indexed-ring-buffer.size

Fixes #1820

- changing from 1024 to 128 based on perf tests
- platform dependent check for Android to set to 16 to reduce memory usage
- changing from 512 to 256 based on perf tests
- platform dependent check for Android to set to 8 to reduce memory usage (use cases on Android should rarely if ever hit the use case with merge that requires the higher buffer sizes for performance)
@benjchristensen
Copy link
Member Author

Going to merge to allow another release candidate and usage. Please provide feedback on whether this works on Android as expected or has problems in any way.

Also let me know if the property names are okay for overriding.

/cc @yogurtearl @mttkay @headinthebox @JakeWharton @neerajrj

benjchristensen added a commit that referenced this pull request Nov 8, 2014
Reduce Ring Buffer Default Sizes (and lower for Android)
@benjchristensen benjchristensen merged commit 2f2b69c into ReactiveX:1.x Nov 8, 2014
@benjchristensen benjchristensen deleted the ring-buffer-size branch November 8, 2014 22:27
@mttkay
Copy link
Contributor

mttkay commented Nov 9, 2014

This sounds sensible to me. We never ran into problems with this, as our sequences are typically quite small (often a single item or a batch of items delivered in a single result), since in most cases for us there is no desire in processing e.g database records or items from a web API fetch one at a time, but rather together as a group, mostly due to the way Android processes view updates (it would be very inefficient to schedule a redraw for, say, every list item emitted.)

@JakeWharton
Copy link
Contributor

Yep. 👍

@yogurtearl
Copy link

Works for our needs. 👍

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.

4 participants