KotlinPlugin: Investigate ways to speed up the detection of Listeners
Seemingly, loading every class in a plugin's package space is pretty slow, and I think it's the main thing slowing down our server startup time compared to a vanilla server. Options are:
Add a cache for what classes are a Listener
This would require getting a hash of the plugin's jar, which isn't hard. When the hash changes, you invalidate the cache. How would we store the cache? YAML files are gross. Bukkit has Java Beans, which can get hidden somewhere by bukkit and are probably easy to use.
Never mind, it's not easy to use. It's bad.
@KotlinListener
annotation
Require that all listeners use a This is fast because annotations are supposed to be fast (i think), and it's easy. However, it's bad because I'd need to manually modify every Listener in every KotlinPlugin, and there's a lot of them.
Use a compiler plugin to scan for Listener classes
lol
Scan for Listener classes in PluginYMLGenerator and write that to a YAML file that can be read at runtime
Now this is the Civ+ way.