Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HWKMETRICS-683] Use the correct scheduler for the insertion work.
- Loading branch information
Stefan Negrea
committed
Jun 29, 2017
1 parent
52a03f8
commit a68ffee
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a68ffee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for the
subscribeOn
becauseaddDataPoints
is already async. If it was a blocking call, then you would want to usesubscribeOn
.a68ffee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsanda, that change doubled the throughput. I am still trying to understand why.
Do you have any insights into what could be going on there?
a68ffee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure. The stuff that executes on subscription are the operators that set up the call chain. As I understand it the callbacks that get passed to operators are not executed on subscription. They get executed when the source observable has a value to emit and push downstream. All of the heavy lifting when values are pushed downstream via
onNext
. I will probably need to look at and run the tests myself. Can you point me to them?Here is something else to consider. With Vert.x and the Cassandra driver we are operating in more async environment than we were with JAX-RS. In general we should not have to be scheduling work on the I/O scheduler since everything should already be async. One of the benefits of the async stack is that we should be able to do more work with fewer resources such as threads.