I am prototyping an application and I though I would try to use Guava’s EventBus component to get rid of some code I was keeping writing again and again to propagate events from fragments to activities for instance.
To my surprise, I got a really big performance hit when activities are starting.
I only do a single EventBus.register call on the activity itself. Removing that call brings back the activity start time to usual. I also noticed quite a lot of garbage collection going on at that time.
Would anyone have advice about Guava’s EventBus and Android? Should I simply go back to the simple fragment listener pattern? Any other library (I was about to try mbassador too, but I am running out of prototyping time).
I ended up simply not using any event bus implementation by lack of time (and the project is small, so it was more of a personal experimentation).
However, there are a number of alternatives to Guava’s EventBus as said by L. Wasserman: Square’s Otto, mbassador, …