Closed Bug 958663 Opened 7 years ago Closed 6 years ago

[keyboard refactor] improve keyboard cold start time

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: djf, Assigned: rudyl)

References

Details

In the past the keyboard was loaded with the system app at boot time. This is changing so that the app does not load until it is first used.  Therefore, the keyboard needs to be optimized for rapid startup.

We want the user to see a keyboard on screen quickly, even if the keyboard is not completely functional when it first appears.

This means that we need to render the keyboard first and get it displayed before querying settings. Optional features like the autocorrect engine should be loaded dynamically after the keyboard is rendered.

I think that it is the inital call to window.resizeTo() that triggers the animation of the keyboard sliding in. If we can know the size of the keyboard in advance (and I think we can) then maybe we should call resizeTo() first and then render the keyboard while the animation is occurring.  If that works and looks good, it could make things faster.

Dynamically loading JSON files for keyboard layouts might be a performance hit as well. Since these are quite small, we might want to include them directly in the app at build time so that a separate load step is not needed.  At least for the most commonly used layouts.  We'll have to measure.
Here is my testing branch to look into this issue,
https://github.com/RudyLu/gaia/tree/test_new_keyboard_loading

From my test, it took about 1.6s for keyboard frame to get mozbrowserloadend event after these steps:

 1. adb shell kill [Demo-keyboard PID]
 2. click an input field to re-launch the demo keyboard.
 3. See the logs
Assignee: nobody → rlu
Depends on: 979764
This'll be a lot less of an issue when bug 992346 lands.
Close this bug as we no longer work on the bugs under bug 956169.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.