Unnecessary compilation happening on every call

The code where I experienced the problem didn’t utilise eval at all. It did use some anonymous functions as part of comprehensions. It shouldn’t be neccesary to do any real dynamic dispatch, since every call utilised the same variable takes etc.
However I realise just now that I am reading and loading some data from JSON input files. It could be that some of those variables are not type constrained, causing some part of the code to be dynamically interpreted. That might be part of my problem. What I still then couldn’t be able to explain is why it at times goes away (subsequent calls start within a second) and then just with a minor code mod (and/or package update), would reappear where subsequent calls would again take a minute to “compile”.
I have in the meantime also moved my code to a module instead of being in Main itself and this issue seems to have (mostly?) disappeared. I’m also mostly calling it from an extra wrapper function, instead of from REPL, which might be helping. I’ll probably be calling it directly from the REPL again during the next few days, so I will try to watch to see if notice it again.