Otto is another event bus library for Android; Actually it ' s a fork of guava ' s eventbus. Greenrobot ' s Eventbus and Otto share some basic semantics (register, post, unregister, ...), but there is differences which The following table summarizes:
|
eventbus |
Otto |
Declare event Hand Ling methods |
Name conventions |
Annotations |
Event inheritance |
Yes |
Yes |
Subscriber Inheritance |
Yes |
No |
Cache Most recent events |
Yes, sticky events |
No |
Event producers (e.g. for coding cached events) |
No |
Yes |
Event delivery in posting thread |
Yes (Default) |
Yes |
Event delivery in main thread |
Yes |
No |
Event delivery in background thread |
Yes |
No |
aynchronous Event delivery |
Yes |
No |
Besides features, performance is another differentiator. To compare performance, we created an Android application, which are also part of this repository (eventbusperformance). You can also run the app. your phone to benchmark different scenarios.
Benchmark results indicate that eventbus are significantly faster in almost every scenario:
|
Eventbus |
Otto |
Posting events, Android 2.3 emulator |
~70% faster |
|
Posting events, S3 Android 4.0 |
~110% faster |
|
Register subscribers, Android 2.3 emulator |
~10% faster |
|
Register subscribers, S3 Android 4.0 |
~70% faster |
|
Register subscribers cold start, Android 2.3 emulator |
~350% faster |
|
Register subscribers cold start, S3 Android 4.0 |
About the same |
The difference between Eventbus and Otto