A suggestion before you make any changes, put @time at the beginning and end of your script and re-direct to a log. That way as you make changes, you can have empirical evidence of any improvements.