I have been running an ever increasing monte-carlo simulation of an atom beam as it exists a Magneto-optical trap and then it’s interaction with multiple laser beams.
Recently I had to add some code that is called upon multiple times. I immediately did this by declaring a function (just as you would do in plain C++). The simulation seemed to work but became MASSIVELY slow!
After searching unsuccessfully, for hours, for a bug in my code I decided I would get rid of the functions and just duplicate the code when needed. This solved the slowness issue completely. Now my script’s performance is back to what it used to be.
I assume that if I were compiling my code, instead of running it as a script, I would have had no trouble…but why does CINT have so much trouble with my functions?