-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed library to use annotations #130
Conversation
- Removed use of onEvent, onEventThreadName - Added @subscribe annotation with an optional threadMode arg
Why? |
@danielbenzvi Because annotations have become the standard way to use reflection in android. This is also a cleaner solution which allows you to name your methods in a way that makes more sense to your app. In addition, we can allow more customization via annotation arguments. We had a conversation in an issue (#126) |
+1 |
@greenrobot CI failed due to a timeout in downloading gradle artifacts. I can't retrigger the build, I dont think that I have the proper permissions |
Done. I'd be curious about registration performance. Could you compare results with the performance app? Especially 1st time subscribers test. Should not make a big difference... |
Right now, it looks like the first time subscriber takes ~1760 microseconds on my nexus 5. Which gives roughly 450/s. A subsequent run gave 720 microseconds and 1400/second |
Which Android version? What's the value in EventBus 2.4.0 without annotations? It might be a good idea to increase the subscriber amount to get more stable results. |
That was in android 4.4.4 |
- Moved check for bridge and synthetic methods up to rule them out asap - Reorganized method finding to be more clear - Added comments - Added logging to method finding if the user enables it
I modified the SubscriberMethodFinder and I am now getting 3700/s roughly in android 4.4.4 |
On my Nexus 5 with Android 5.0, I get >26,000/s on EventBus 2.4 with 100,000 subscriber count. |
@greenrobot ah ok. I was doing 1st subscribe with 100 set |
@greenrobot I was wondering if you have had any time to check out these changes. We would like to start testing internally with a jar that I can build, but I want to make sure the syntax would remain pretty much how it is in this pull request. |
@greenrobot Any updates? |
Did not have the chance have a closer look yet. |
@greenrobot do you know when you will have a chance to take a deeper look? I am hoping to use this library in our application, but I am holding out until annotations are a part |
@greenrobot We are also waiting for this feature... |
+1 |
Thanks! |
The library now requires the use of annotations in order for a method to be subscribed to an event.
@Subscribe
public void mySubscribingMethod(MyEvent event)