Igor9 slow running Macro function

I am looping through a function in Igor9 and the first several times I run the function (~100 times) the function runs at an okay speed (a few seconds), but the more I loop through the function the longer it takes. It goes from running in a few seconds to several minutes. I have run this function in Igor8 and have had no problem with the performance slowing down. Any idea why it would be slowing down in Igor9?

 

Hi Ben - I am happy to share the file/code I am using but the file is ~2GB. Is there another way I can send you the file other than attaching to this forum thread. Google files or dropbox would work for me.