Messengers Increasing Runtime

Hi!
I’ve recently implemented a couple of messengers into my code in order to change the thickness of an x-ray target, for example, using a macro loop. This works very well, but seems to have increased the runtime of my code hugely. I am currently running single-threaded so of course can speed it up by using multi-threading, but I was wondering if anyone else had this issue? And if there are any other workarounds?

Thank you,
Lauryn