Hello, dear reader.

Disclaimer

RxJava has became a critical component of huge amount of modern apps, we use it for everything: networking and other io, calculations and so on.

Motivation

Recently, guys from NY Times found a major issue in RxJava that affects performance of applications: NewThreadWorker.tryEnableCancelPolicy doing costly reflection on Android

Goal

So, to keep myself calm and continue using RxJava without worries, I decided to make full code review of RxJava sources, understand it better, create issues and PRs if I find something suspicious and share some results with you to save your time.

Part 1

RxJava v1.0.13, commit a3a0b1ff6a3e3a8ce185cce9c74f8b8f7826f10e code metrics (exluding tests):

811 KB rxjava-1.0.13.jar

rxjava-1.0.13.jar 755 classes , that's a lot for review…

, that's a lot for review… 3263 methods, LGTM, but don't forget about 65K methods limit on Android.

methods, LGTM, but don't forget about 65K methods limit on Android. 43649 lines of code , I guess, I'll spend couple of weeks on that.

, I guess, I'll spend couple of weeks on that. 78% code coverage, that's good, but some of the classes have very small coverage (several classes with 0 coverage).

Some diagrams and graphics:

Number of classes by package



Lines of code by package



Code coverage



Tools I've used:

Related issues and PRs:

Also, one of the main RxJava developers — @akarnokd David Karnok (definitely follow him in Twitter and read his blog about RxJava internals!) showed interest in improving code coverage in the project and his last PRs make situation better, that's great.

This was Part 1.