Module observability listener performance issue on publishEvent #1149
Labels
in: observability
Observability support
meta: waiting for feedback
Waiting for feedback of the original reporter
type: improvement
Minor improvements
In
org.springframework.modulith.observability.ModuleEventListener#onApplicationEvent
search for module by type uses simpleName which means it cannot short-circuit condition inorg.springframework.modulith.core.ApplicationModule#contains(java.lang.String)
with package name. The search is implemented on streams so it does not scale well with increasing number of classes. As a result it has to scan hundreds of classes with ArchUnit on each publishEvent call.There are 21 modules and 1180 classes in my project and on publishEvent there is significant perfomance hit from ModuleEventListener.
I use Modulith 1.3.1 but based on code source the issue will be the same in 1.4.0
The text was updated successfully, but these errors were encountered: