Closed Bug 982269 Opened 10 years ago Closed 10 years ago

5 reflows in keyboard

Categories

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

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3T+, b2g-v1.3T fixed, b2g-v1.4 fixed)

RESOLVED FIXED
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: janjongboom, Assigned: janjongboom)

References

Details

Attachments

(1 file)

There are still at least five reflows left in the keyboard code on 1.3t

* Reflow on highlight of special keys
* showAlternatives menu has reflow (uses getWindowLeft)
* reflow: 0.84ms function showCandidates, render.js line 341
* reflow: 1.08ms function showCandidates, render.js line 351
* reflow: 2.74ms function getScale, render.js line 895

The first one affects all keyboards, the last three only keyboards with autosuggest. The last one is called three times per character press.
Attached file Patch for four of them
This fixes the reflows, except the one for the alt menu, because that code is supertangled with everything.

There is another reflow that you can see now, which is triggered from CSS. I don't know yet what causes it...

This patch does pass the UI tests and unit tests, but has not been tested in landscape, on higher res devices or on Chinese IME.
Attachment #8389379 - Flags: review?(rlu)
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → All
Jan,

Thanks again for looking into this.
Will try to evaluate and test the above parts you mentioned to make sure no regressions.
Comment on attachment 8389379 [details] [review]
Patch for four of them

It seems this broke auto-correction function?
When trying to input "Koi" and then press enter, it should be corrected to "Join" but was not.

Could you double check this?
Thanks.
Attachment #8389379 - Flags: review?(rlu)
Comment on attachment 8389379 [details] [review]
Patch for four of them

Sorry, please ignore the previous comment.
I probably mismatched gaia with a wrong version of gecko.

Will check it again.
Attachment #8389379 - Flags: review?(rlu)
Comment on attachment 8389379 [details] [review]
Patch for four of them

It seems that this patch still need some follow-ups:
 1. The style of suggestion is slightly changed.
    1.a The dismiss button for latin suggestion is not vertically center aligned.
        Now, it aligns to bottom.
    1.b We had a gray bottom border before, but now it is gone.

 2. The suggestion (candidate) panel won't get reset for Chinese IME.


Jan, do you have bandwidth to look at these as follow-ups?
Thanks.
Attachment #8389379 - Flags: review?(rlu)
Comment on attachment 8389379 [details] [review]
Patch for four of them

I fixed all three issues here, plus fixed all the sync reflows I could find (except the alternative menu). Runs about twice as fast on my Keon vs. original 1.3t branch.
Attachment #8389379 - Flags: review?(rlu)
Here are some perf measurements on a Peak with a string of ~470 chars.

          1.3    |    1.3t     |     this patch
------------------------------------------------
min       8      |    7        |     6
max       296    |    247      |     128
avg       98     |    62       |     27

Big difference on max & avg.
On Keon with the same string. Both tests were running in a textbox with autocorrect + autocapitalization.

          1.3    |    1.3t     |     this patch
------------------------------------------------
min       18     |    18       |     13
max       232    |    168      |     90
avg       81     |    65       |     33
Blocks: 857907
blocking-b2g: --- → 1.3T+
Add our gaia team member here.
This is a reflow optimization example. 
You can ask the owner Jan Jongboom how to get the reflow times.
Jan's mail,

Reflows can be analyzed via the App Manager, connect the app manager to a running application and on the Console tab, under CSS, enable 'Log'. Sync reflows from code will have a stack trace, reflows from CSS or async reflows won't.
Comment on attachment 8389379 [details] [review]
Patch for four of them

r+ from me with some nits to be addressed.

Jan,

Thanks for your great help for improving this.
Attachment #8389379 - Flags: review?(rlu) → review+
Up with Jan!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: