You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that the fastest coroutine variant runs in a ~5.6 seconds
however, the RxJava variant runs in ~2 seconds,
If I understand correctly,
RxJava runs every request on a different thread and holds it while the coroutine uses a looper to schedule all of the io on the same thread, saving space.
I've tried achieving better performance on coroutines to be in par with RxJava but failed,
can you better explain that? it seems to me that the RxJava variant is much better because of that (for time optimization).
The text was updated successfully, but these errors were encountered:
I found out that it's because the OkHttp client has a default limit on maxRequestsPerHost which is 5, so it only sends 5 requests at the same time. And the RxJava variant seems no limit on this.
If you modify the maxRequestPerHost value to 1000 for example, the coroutine variant is as fast as the rxjava variant. @ndori
I've noticed that the fastest coroutine variant runs in a ~5.6 seconds
however, the RxJava variant runs in ~2 seconds,
If I understand correctly,
RxJava runs every request on a different thread and holds it while the coroutine uses a looper to schedule all of the io on the same thread, saving space.
I've tried achieving better performance on coroutines to be in par with RxJava but failed,
can you better explain that? it seems to me that the RxJava variant is much better because of that (for time optimization).
The text was updated successfully, but these errors were encountered: