That code is literally doing 10,000 function calls, 10,000-40,000 concatenates. Nearly 100,000 if checks and 100,000 table look ups. It doesn't matter how many options they've set, there's no check for that. As written, that code does that for loop 10,000 times. The very first line alone within it will cause 10,000 function runs via GetAlternateInfoByID()
I'd bet a lot of money that's where your lag is coming from
|