Greetings,
We have in our company a lot of arch unit tests running. So I looked into the profiler to see what could be a straight forward way to achieve a runtime performance benefit.
I saw that the packages are being matched using regex. Regex is fast for sure. Yet simple String comparison is even faster.
That's why I created this simplified package matcher. I provide a patch in the attachment.
The performance gain was roughly 10% for my test case.
What do you think? I think it brings enough benefit that it's not premature optimisation.
Example_implementation_of_package_matcher_with_starts_with_implementation_instead_of_using.patch