Fixed the rotate performance issue

Fixed the rotate performance issue