the eventbus logic is that you’re likely to have a lot of events, but only one or two busses (or, at least, a small amount of them). we also want all accesses to be simple offsetting (vec indexing).
(side-note: I actually had no idea Any was fast when I was making the thing, but once I found out I didn’t finish the optimizations. in fact, one of the alternatives is to just make Any painfully slow and my code will still work just fine and fast if I finish those optimizations.)
this means I need to convert slow AnyMap/T to a fast (monotonically assigned) usize. this needs to be stored in the caller, because we can’t have generic statics (static FOO<T>: Foo<T> = FOO_INIT;). - in fact, generic statics would also solve the TypeId problem, as mentioned in the original issue. this is exactly what makes these problems so similar, and is exactly what’s being worked around by my proposal.
anyway, once we have the usize, we can just skip the slow lookups and do a fast lookup.