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

Server HttpConnectionHandler optimization (remove flatmap) #164

Closed
NiteshKant opened this issue Jul 2, 2014 · 1 comment
Closed

Server HttpConnectionHandler optimization (remove flatmap) #164

NiteshKant opened this issue Jul 2, 2014 · 1 comment
Milestone

Comments

@NiteshKant
Copy link
Member

Based on our benchmarking the use of Observable.flatMap() inside HttpConnectionHandler here incurs an unnecessary overhead.
The below flamegraph shows the overhead:

httpconnhandlerflatmap

In this particular instance, flatMap() does not seem to be useful, it can easily be replaced by a custom operator which connects the connection.getInput()'s onComplete() and onError() to the subscriber of HttpConnectionHandler.handle() The result of RequestHandler.handle() does not impact the subscriber of HttpConnectionHandler.handle()

@NiteshKant NiteshKant added this to the 0.3.7 milestone Jul 2, 2014
@NiteshKant NiteshKant self-assigned this Jul 2, 2014
NiteshKant pushed a commit to NiteshKant/RxNetty that referenced this issue Jul 2, 2014
Removed the use of flatMap() with a custom operator.
NiteshKant pushed a commit to NiteshKant/RxNetty that referenced this issue Jul 3, 2014
Removed the use of flatMap() with a custom operator.
Use Subscriber instead of Observer
NiteshKant pushed a commit to NiteshKant/RxNetty that referenced this issue Jul 3, 2014
ReactiveX#164: Removed flatMap() usage in HttpConnectionHandler in favor of a custom operator.
ReactiveX#166: Defined a facility to also specify the acceptor event loop. RxNetty defaults to an acceptor event loop with 1 thread. Also, the number of worker threads == number of available processors.
ReactiveX#167: Not sending Connection: keep-alive for HTTP 1.1. protocol
NiteshKant added a commit that referenced this issue Jul 3, 2014
@NiteshKant
Copy link
Member Author

Here is the flamegraph after this fix:

httpconnhandlerflatmapremoved

@NiteshKant NiteshKant removed their assignment Aug 19, 2014
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

1 participant