toward a more efficient event loop
Nicolas Cellier <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.general |
|---|---|
| Message-ID | <CAKnRiT6ja=zH9OTAqiCtD9Ze5-WeUpYtmcy_Kp+Mtb0FXMi9HA@mail.gmail.com> |
Hi all, if you compare Cuis morphic feel to Squeak morphic feel, the former looks snappy, the latter sluggish. Especially if your trackpad generates a bunch of MouseWheelEvent (MouseScrollEvent in Cuis) whenever you're willing to scroll. Why is that? Squeak World goes through an interCyclePause: at every mouse event. Indeed, when the hand *processEvents* it stops at first mouse event encountered. Hence, unless you are ready to sacrifice some battery life with a Preferences higherPerformance, the event buffer might take several seconds to drain with such strategy, especially on mac. It makes the user experience somehow catastrophic. Cuis has a different strategy: - processEvents drains the event buffer. however, it only processes one mouse move event per cycle, and drops the other ones. - the world cycle doesn't pause if (lastCycleHadAnyEvent or: [ deferredUIMessages isEmpty not ]) - it also does not pause further than the next morphic step or alarm - the pause grows gradually from 20 to 200ms whenever there is no activity but at least %)ms in server mode Maybe it's time to revise our strategy too ! Nicolas Squeak-dev mailing list -- [email protected] To unsubscribe send an email to [email protected]