optmize the adhoc planner cache statics calculations