The difference between Eventbus and Otto

Source: Internet
Author: User
Tags benchmark eventbus

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.