starbugs / icedcoffee

A lightweight OpenGL user interface framework written in Objective-C
BSD 3-Clause "New" or "Revised" License
47 stars 7 forks source link

Control event dispatch exhibits bad performance on iOS #7

Open starbugs opened 11 years ago

starbugs commented 11 years ago

ICTouchEventDispatcher performs hit tests on each touchesMoved: event received, which results in bad performance when dragging over ICControl-based nodes. A draggable control will receive touchesMoved: events too late on iOS devices, resulting in a serious lag when dragging over the touch display.

starbugs commented 11 years ago

The issue has been fixed partially by avoiding processing multiple touchesMoved: events per frame in control event dispatch on iOS. This allows for acceptable performance in a simple test environment where a single touch is processed. However, even for a single touch (continuously moving) the framerate drops from 60 FPS to about 40 FPS on an iPhone 4S. Further optimizations for the iOS platform are required to improve this.

This fix may cause problems in configurations using on demand frame updates. This will be fixed as soon as extensive testing is done.