iberianpig / fusuma

Multitouch gestures with libinput driver on Linux
MIT License
3.67k stars 149 forks source link

Optimize gesture buffer #301

Closed ces42 closed 1 year ago

ces42 commented 1 year ago

This PR has the changes I explained in https://github.com/iberianpig/fusuma/pull/296 (that's the first commit). Following the same pattern I added more caches to avoid looking at the whole buffer over and over again. The ruby 2.5 incompatibility that you mentioned in the review should be fixed.

Benchmark: I ran 20000.times { pipeline } with both versions, feeding them touchpad events that I had recorded for a couple of hours. The results show a 20% speedup

version time
b68ab603 5.987 s ± 0.112 s
this PR 4.927 s ± 0.022 s