optimize mesh processing