RxJava Performance Testing

1,474 views
Skip to first unread message

user392919

unread,
Sep 7, 2015, 3:25:37 AM9/7/15
to RxJava
Hello,

I am very new to RxJava. I tried only couple of (small) samples. I would like to know about Rx Java's performance improvement in the application. Searching in Google I could only find RxJava improve the readability and easy to maintain the code. But couldn't find anything on it's performance gaining. 
Say for example I have a small http pass-through server written in netty. and If I introduce Rx java, will there be a performance improvement. To Try this out could anyone please provide me a small sample in Rx Java which will help me to understand Rx java's impact of performance

Regards
Mac   

Ben Christensen

unread,
Sep 9, 2015, 12:26:24 PM9/9/15
to user392919, RxJava
RxJava itself does not increase performance of an application. In fact, it is overhead as it adds object allocation and method invocations compared with a procedural, imperative approach. 

The manner in which RxJava helps achieve improvements is by providing abstractions for concurrency, asynchrony, and callback composition with error handling and flow control – all things that can be done without RxJava, but are difficult and tedious to do without abstractions. 

The overhead of RxJava is generally not applicable when composing async IO. It can become an issue when RxJava is used (often overused) in synchronous situations where it is better to use imperative code inside a broader functional composition. As in all things, there is no silver bullet.

Take a look at the following for RxJava related examples:


In short, RxJava alone will not increase performance of your application. Adoption of concurrency and async architectures can (not will), and RxJava provides a programming model for embracing concurrency and asynchrony.

Ben

Luke Daley

unread,
Sep 10, 2015, 12:44:27 AM9/10/15
to Ben Christensen, user392919, RxJava
Great answer.

user392919

unread,
Sep 10, 2015, 2:50:27 AM9/10/15
to RxJava, user3...@gmail.com
Thank you Ben !
Reply all
Reply to author
Forward
0 new messages