Orbit 0.3.0 - #9
Open
crosby-moe wants to merge 17 commits into
Open
Conversation
Contributor
Author
|
closes #3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API Changes:
IEventBus#registerLambdaFactorywithIEventBus#registerLookup, what was beforebus.registerLambdaFactory("com.example", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));is now justbus.registerLookup("com.example", MethodHandles.lookup());IListener#isStatic(LambdaListener#isStaticis still available)IEventBus#isSubscribed(Object)to query if an object was subscribed thoughIEventBus#subscribe(Object)IEventBus#isSubscribed(Class)to query if a class was subscribed thoughIEventBus#subscribe(Class)IEventBus#isSubscribed(IListener)to query if a listener was subscribed thoughIEventBus#subscribe(IListener)Internal Changes:
EventBus#listenerCacheis now a synchronizedIdentityHashMapinstead of aConcurrentHashMapaccessed through iteration. Higher constant overhead, but much lower worst-case performance. Also fixes issues caused by mismatched identity hashing vs value hashing.EventBus#listenerCache&EventBus#staticListenerCachenow only hold listeners that are currently registered to the event bus. Caching for transient listeners moved toEventBus#LAMBDA_FACTORY_CACHEin a way that permits both object gc and class gc. Also reuses lambda factories when registering multiple lambda listeners of the same owning class to reduce hidden class creation and improve performance.EventBus#lookupInfosare now ordered from longest to shortest package prefixes, such that a registered"com.example.specific"is not overshadowed when a"com.example"from another module was registered earlier.MethodHandle#invokeExactfor executor creation.Regressions
LambdaListenerinstances were indefinitely stored in a cache. It would be possible to bring back this cache while also making it garbage collectable through aWeakHashMap, however it would also greatly increase the memory usage.Possible Improvements
LookupInfoand event posting speed forLambdaListener&ConsumerListeneron java 16.