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
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