Skip to content

Commit

Permalink
Moved comparison to Otto into COMPARISON.md
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot committed Nov 25, 2014
1 parent ccc2771 commit 837fc09
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
98 changes: 98 additions & 0 deletions COMPARISON.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
EventBus Comparison
===================

Comparison with Square's Otto
-----------------------------
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 are differences which the following table summarizes:
<table>
<tr>
<th></th>
<th>EventBus</th>
<th>Otto</th>
</tr>
<tr>
<th>Declare event handling methods</th>
<td>Name conventions</td>
<td>Annotations</td>
</tr>
<tr>
<th>Event inheritance</th>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<th>Subscriber inheritance</th>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<th>Cache most recent events</th>
<td>Yes, sticky events</td>
<td>No</td>
</tr>
<tr>
<th>Event producers (e.g. for coding cached events)</th>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<th>Event delivery in posting thread</th>
<td>Yes (Default)</td>
<td>Yes</td>
</tr>
<tr>
<th>Event delivery in main thread</th>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<th>Event delivery in background thread</th>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<th>Aynchronous event delivery</th>
<td>Yes</td>
<td>No</td>
</tr>
</table>

Besides features, performance is another differentiator. To compare performance, we created an Android application, which is also part of this repository (EventBusPerformance). You can also run the app on your phone to benchmark different scenarios.

Benchmark results indicate that EventBus is significantly faster in almost every scenario:
<table>
<tr>
<th></th>
<th>EventBus</th>
<th>Otto</th>
</tr>
<tr>
<th>Posting 1000 events, Android 2.3 emulator</th>
<td>~70% faster</td>
<td></td>
</tr>
<tr>
<th>Posting 1000 events, S3 Android 4.0</th>
<td>~110% faster</td>
<td></td>
</tr>
<tr>
<th>Register 1000 subscribers, Android 2.3 emulator</th>
<td>~10% faster</td>
<td></td>
</tr>
<tr>
<th>Register 1000 subscribers, S3 Android 4.0</th>
<td>~70% faster</td>
<td></td>
</tr>
<tr>
<th>Register subscribers cold start, Android 2.3 emulator</th>
<td>~350% faster</td>
<td></td>
</tr>
<tr>
<th>Register subscribers cold start, S3 Android 4.0</th>
<td colspan="2">About the same</td>
</tr>
</table>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ How-to, Developer Documentation
-------------------------------
Details on EventBus and its API are available in the [HOWTO document](HOWTO.md).

How does EventBus compare to other solutions, like Otto from Square? Check this [comparison](COMPARISON.md).

Additional Features and Notes
-----------------------------

Expand Down

0 comments on commit 837fc09

Please sign in to comment.