Optimize script update performance