Any way to look under the hood for lag issues?

I had a setup button that was taking ~10 seconds to set up a new game. A bit long, but acceptable.

Then I massively reworked a whole ton of stuff in response to a user request and now the setup takes anywhere from 30 seconds to 2 minutes!

Trying to track down the source of the massive increase is really time-consuming and frustrating. Is there any way to analyse this other than trial and error? Cut out stuff until it speeds up, then rework it? I would love to have some other options. Everything works fine, but fine-tuning the speed of a Vassal module is no fun.

Too much state and too many click handlers and you get these kinds of modules.
It’s been a while since I’ve made a module, but I seem to remember one can potentially cut down setup time loading a setup file versus “in-code” setup.