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

flatMap: fixed scalar-merging. #2878

Closed
wants to merge 1 commit into from

Conversation

akarnokd
Copy link
Member

FlatMapping over a sequence of scalar observable values while observing them from a different thread did not work: items in the scalar queue where ignored by some terminal checks.

@benjchristensen
Copy link
Member

Is this a replacement for your significant rewrite of merge? Are you still trying to rewrite it or just incrementally adjust it as done here?

@akarnokd
Copy link
Member Author

No, this is still incremental. The full rewrite will only happen for 2.0.

@benjchristensen
Copy link
Member

Cool, I like that approach better. That context helps me review this.

Don't spend too much time on the 2.0 rewrite quite yet though until we figure out some of the foundational abstractions and contracts.

if (moreToDrain) {
drainQueuesIfNeeded();
}
request(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future rewrite we can optimize this because it could drain queues and request(n) and then immediately request(1) again.

@benjchristensen
Copy link
Member

I'm not ready to proceed with this PR. I've added some comments above. The key part that concerns me is that we are changing to always route through a queue for scalar values when request(n) < Long.MAX_VALUE is happening.

@benjchristensen benjchristensen mentioned this pull request Apr 30, 2015
@akarnokd
Copy link
Member Author

Apparently a full rewrite can't be avoided.

@akarnokd akarnokd closed this Apr 30, 2015
@benjchristensen
Copy link
Member

If you're going to pursue a full rewrite, make sure to pay attention not just to the JMH throughput numbers, but also the object allocation rates.

I expect a rewrite of merge to take some non-trivial time to write, review and test considering the history and attempts made. It is a far more important operator performance-wise than most.

@akarnokd akarnokd deleted the flatMapJustFix branch May 6, 2015 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants