fix(web): disable fat-finger predictions for perf#5314
fix(web): disable fat-finger predictions for perf#5314
Conversation
Actually, it's still used, even then. keyman/common/core/web/input-processor/src/text/inputProcessor.ts Lines 157 to 159 in 349e144 keyman/web/source/dom/domOverrides.ts Lines 19 to 41 in 349e144 It's literally at the core of how embedded operates. |
|
So... now that #5319's been merged in, I think points 1 and 3 are now moot. Point 2 (embedded I suppose point 1 can see a bit of effect, though #5319's context windowing will have preapplied this for the lion's share of cases already. The only aspect not covered by at PR's context windowing is for the results of the base keystroke. |
I've been continuing to test this with no side effects observed on Android. Have not tested on iOS. I'll be trying to setup a pair of PRs to tidy this up today, so we can close this off and get the release out. |
I've been diverted onto other fires so will not get to this until next week now. |
Fixes #5258. And a little bit more.
The core change here is disabling fat finger predictions. The changes here improve perf from 380ms/keystroke to <10msec/keystroke.
The downside to this is obviously that fat-finger based predictions are no longer available. In my (limited) tests, I was not able to observe a visible reduction in prediction quality. In my opinion, reduction in prediction quality is outweighed by improvement in performance. (This is a shame and makes me sad, but I think we need to be willing to make significant decisions like this, even if we have invested a lot of effort into the code. See sunk cost fallacy.)
But this is not a complete solution. I have left the code in, commented out. If we decide to remove fat finger altogether, there is a lot of additional code we strip out. I think we need to do this, with a view to re-adding it later if we can bring performance up to scratch.
Three changes. Tested on Samsung Galaxy A90, 3800 character document in Keyman app.
Before: 380ms/keystroke.
Implement sliding window for
buildTransformFrom(not currently used, see point 3). But did improve performance by about 30msec, so thought I'd leave it in.Set CSS for the input backing textarea to
display: none, as we never actually need to focus it. Improved performance further by 60msec by eliminating a Layout recalc in the webview.It was clear after making those changes, that the vast majority of the calc time left was in fat finger calculations. Disabled fat fingering . Improved performance further by 280msec (310msec total incl. point 1).
After: 10ms/keystroke.