optimize sprite generation to avoid wating delay