alexpasmantier / television

The revolution will (not) be televised
https://crates.io/crates/television
MIT License
116 stars 3 forks source link

perf: input delay #13

Open Aumnescio opened 2 days ago

Aumnescio commented 2 days ago

Demonstration

Here are two clips comparing character input performance of fzf and tv.

https://github.com/user-attachments/assets/b8f00aa6-75b8-44f1-8d59-3ce79cfc9b57

https://github.com/user-attachments/assets/00542422-76f0-4ef8-9d61-fdb5eca5753b

Admittedly, this is not a fair comparison because the tick-rate and frame-rate of television were kept at the default values of 50 and 60 respectively, while fzf has no such limits by default. However, by having the other tool be artificially limited, the difference in input delay can be demonstrated much more clearly.

If television is launched with tv --tick-rate 165 --frame-rate 165, the perceived speed of tv drastically improves, but it does still look and feel slower than fzf. On a recorded video, the performance difference would be hard to spot, hence the above demonstration to illustrate the point.

I am not quite sure what the clips will look like on a 60hz monitor, or if browsers will even display the clips at maximum framerate. On Firefox, (and on 165hz display) the clips seem to be playing at a high framerate. If the difference is not obvious, the clips could be downloaded and played frame-by-frame. On the fzf clip, approximately 1 'a' character updates per frame. On the tv clip, approximately 3 a characters update every 4 frames.

Relevance

The degree to which this is a real problem probably depends quite heavily on the sensitivity of the user. Personally, if I can feel a "slowness", it is a critical issue for me. I know others that are far less sensitive, and might not even notice a difference.

My System Info

Edit: I use the xset tool and xset r rate 186 112 command to increase my keyboard repeat-rate. With a default repeat-rate, the input delay is probably way harder to notice in day to day usage.