Alpine icon indicating copy to clipboard operation
Alpine copied to clipboard

Custom Event to Listener Maps

Open ZeroMemes opened this issue 2 years ago • 0 comments

There's no way to control the underlying implementation of EventManager.activeListeners.

The current implementation in 3.0.0 is backed by a Reference2ObjectOpenHashMap, which is allowed to infinitely grow. However, some applications may use an EventBus which has a fixed amount of known event types (Baritone :eyes:). In such a case, a perfect hashing function could be used for optimized lookup.

I'll need to do some research into automatically generating perfect hash functions, and a lot of benchmarking to see if/when something like this can actually have a statistically significant performance benefit.

ZeroMemes avatar May 23 '23 07:05 ZeroMemes