Comment by kdrag0n
5 years ago
It's worth noting that it's still possible to achieve low latency with modern hardware and even software to some extent, even with all the input filtering on touchscreens. The modern GPU rendering stack won't be able to do it, but I was able to do it in software without giving up the Linux kernel, IRQs, or the input stack.
My experiment got down to ~10 ms average tap latency on a 60 Hz phone with a touchscreen scanning at 240 Hz: https://twitter.com/kdrag0n/status/1291213993219039232
Source code: https://github.com/kdrag0n/touchpaint
I have to say that writing on phones really feels much more interactive and natural when the latency is so low. I don't personally feel like these ranges of latency are that big of a deal on desktop computers where input is indirect, but it feels much more significant on phones where your interactions are right underneath your finger.
The newest Apple Pencil is apparently around 9ms [1]. It really does fool your brain into thinking something is coming out of the tip.
[1] https://www.macworld.com/article/3402336/apple-pencil-change...
If only they cared about such things for Terminal.app, so we didn't have the extra step of installing Alacritty on every single machine to improve the situation (and not to anywhere near 9ms, even).
Isn't Terminal.app famously pretty speedy compared with most other terminal emulators? In fact, there's a link from this article to another of Dan's posts that's precisely about terminal performance - https://danluu.com/term-latency/
It's a few years old now so I've no doubt that Alacritty's performance has improved, but I'm suspicious of the idea that Terminal.app is noticeably slow.
1 reply →
I've always found this a bit funny - why are people so concerned with input latency at the terminal? (I get why I care with a phone, or gaming). It's not like anyone's typing hundreds of characters a second. I use Alacritty, but mostly because I like the way it's config file works and it does nice font rendering. The latency thing barely even registers.
9 replies →
URxvt on a 144hz gaming monitor is excellent.
1 reply →
Huh? Terminal.app is one of the fastest ones. iTerm2 is much slower in comparison.
At least for me, the terminal is the only place where latency is tolerable on underpowered, crappy machines. This is because my keyboard input stream will always trigger behavior deterministically in the terminal.
There was an iOS 9 glitch that disabled all animations, and it was so satisfying to open apps and have them show up immediately. Made the phone feel super fast
There’s still an option in accessibility to “Reduce Motion”. It does feel slightly quicker. But most animations are changed by a less visually impactful fade
This is an option in developer settings for androids, it does feel very nice
I looked in the dev settings but could not find it? What's the exact name of the option?
2 replies →
You don't need to jump through all the hoops you did. Many Android devices, high end ones anyway, support front buffer rendering via public APIs, such as through this extension: https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_...
Or if Vulkan is more your jam, doable with: https://www.khronos.org/registry/vulkan/specs/1.2-extensions...
And then "no-latency" input events can be done via View#requestUnbufferedDispatch ( https://developer.android.com/reference/android/view/View?hl... )
I'm sure there's then some way to achieve front-buffer rendering in a software rendered pipeline as well to cut out the GPU latency & avoid tile-based artifacts.
Interesting, I might give those rendering APIs a shot. Thanks for the tips.
I did try requestUnbufferedDispatch though, and it didn't make a noticeable visual difference, but I need to measure it to make sure.
How do your flutter and Android apps compare by the way?
They both have much higher tap latency due to the Android graphics stack. The difference in drag/scroll latency feels even higher, but I don't know how to measure that quantitatively without special equipment.
Example of ROG Phone II results:
Kernel module, display running at 60 Hz: 10 ms
Android, 120 Hz display: 32 ms
Flutter, 120 Hz display: 30 ms
They're only this close because Android gets 2x the refresh rate here, but it's still 3x slower.
Running list of latency tests on many different phones: https://docs.google.com/spreadsheets/d/1mahGpTKZLgKpaBDvcNR7...
Those Pixel 5 measurements are impressive if it’s a stock Android app.
Thank you!