Closed Bug 927323 Opened 11 years ago Closed 11 years ago

Showing keyboard suggestions creates a high number of reflows on every key press

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: vingtetun, Assigned: drs)

References

Details

(Keywords: perf)

Attachments

(1 file, 2 obsolete files)

Attached patch View keyboard app reflows (obsolete) — Splinter Review
Everytime a new suggestion is created this triggered a high number of reflows. I'm not sure how to fix that but this will greatly improve keyboard responsiveness if we can. Here is an example stack of what happening (time in parenthesis are in ms) by typing 'Tyu': 'T' I/GeckoDump( 2576): uninterruptible Reflow (2.0446789999259636) I/GeckoDump( 2576): uninterruptible Reflow (2.5939939999952912) I/GeckoDump( 2576): Stack: kr_draw@app://keyboard.gaiamobile.org/gaia_build_index.js:6|setUpperCase@app://keyboard.gaiamobile.org/gaia_build_index.js:100|updateCapitalization@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:851|click@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:379|endPress@app://keyboard.gaiamobile.org/gaia_build_index.js:176|handleTouchEnd@app://keyboard.gaiamobile.org/gaia_build_index.js:142|handleTouches@app://keyboard.gaiamobile.org/gaia_build_index.js:143|onTouchEnd@app://keyboard.gaiamobile.org/gaia_build_index.js:139| I/GeckoDump( 2576): uninterruptible Reflow (16.26586799987126) I/GeckoDump( 2576): Stack: candidatePanelToggleButtonCode@app://keyboard.gaiamobile.org/gaia_build_index.js:51|kr_draw@app://keyboard.gaiamobile.org/gaia_build_index.js:13|setUpperCase@app://keyboard.gaiamobile.org/gaia_build_index.js:100|updateCapitalization@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:851|click@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:379|endPress@app://keyboard.gaiamobile.org/gaia_build_index.js:176|handleTouchEnd@app://keyboard.gaiamobile.org/gaia_build_index.js:142|handleTouches@app://keyboard.gaiamobile.org/gaia_build_index.js:143|onTouchEnd@app://keyboard.gaiamobile.org/gaia_build_index.js:139| I/GeckoDump( 2576): uninterruptible Reflow (1.0375980000244454) I/GeckoDump( 2576): Stack: showCandidates@app://keyboard.gaiamobile.org/gaia_build_index.js:15|kr_draw@app://keyboard.gaiamobile.org/gaia_build_index.js:13|setUpperCase@app://keyboard.gaiamobile.org/gaia_build_index.js:100|updateCapitalization@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:851|click@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:379|endPress@app://keyboard.gaiamobile.org/gaia_build_index.js:176|handleTouchEnd@app://keyboard.gaiamobile.org/gaia_build_index.js:142|handleTouches@app://keyboard.gaiamobile.org/gaia_build_index.js:143|onTouchEnd@app://keyboard.gaiamobile.org/gaia_build_index.js:139| I/GeckoDump( 2576): interruptible Reflow (3.295898000127636) 'Y' I/GeckoDump( 2576): uninterruptible Reflow (1.9226069999858737) I/GeckoDump( 2576): uninterruptible Reflow (2.68554800003767) I/GeckoDump( 2576): uninterruptible Reflow (0.7629399999277666) I/GeckoDump( 2576): Stack: showCandidates@app://keyboard.gaiamobile.org/gaia_build_index.js:15|kc_glue_sendCandidates@app://keyboard.gaiamobile.org/gaia_build_index.js:204|handleSuggestions@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:648|setLanguage/worker.onmessage@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:267| I/GeckoDump( 2576): interruptible Reflow (3.967285000020638) 'u' I/GeckoDump( 2576): uninterruptible Reflow (1.953125) I/GeckoDump( 2576): uninterruptible Reflow (2.9907219999004155) I/GeckoDump( 2576): uninterruptible Reflow (0.7629400000441819) I/GeckoDump( 2576): Stack: showCandidates@app://keyboard.gaiamobile.org/gaia_build_index.js:15|kc_glue_sendCandidates@app://keyboard.gaiamobile.org/gaia_build_index.js:204|handleSuggestions@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:648|setLanguage/worker.onmessage@app://keyboard.gaiamobile.org/js/imes/latin/latin.js:267| I/GeckoDump( 2576): interruptible Reflow (3.0822750000515953) Tim do you have some resources to work on that?
Flags: needinfo?(timdream)
For what it worth the code to see reflows will move into a devtool to make it easier to use (see bug 926371)
Keywords: perf
I would redirect ni? to djf as he intend to take over keyboard UI from v1.3.
Flags: needinfo?(timdream) → needinfo?(dflanagan)
Assignee: nobody → bugzilla
Setting reviewer to :djf for now. I'll look into who this might be better to request review from.
Attachment #8360145 - Flags: review?(dflanagan)
Comment on attachment 8360145 [details] [diff] [review] Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/15336 Whoops, sorry. Wrong thread. But I'll look into this too.
Attachment #8360145 - Flags: review?(dflanagan)
You can set me as reviewer on this kind of stuff.
I'm unable to repro this. I'm only getting 1 reflow per update to the suggestions bar using the patch vingetun posted. I'm closing this and it can be reopened if someone else is able to repro. I'm also attaching a rebased version of this patch. Also note that, if you want to use this patch, you must change the following (you can use any combination of flags): diff -r 314af861fd73 b2g/chrome/content/shell.js --- a/b2g/chrome/content/shell.js Wed Jan 15 16:21:59 2014 -0800 +++ b/b2g/chrome/content/shell.js Wed Jan 15 17:17:00 2014 -0800 @@ -618,7 +618,7 @@ this.sendEvent(window, 'ContentStart'); - lookReflows(getContentWindow()); + lookReflows(getContentWindow(), {'reflows': true, 'repaints': true, 'css': true}); Services.obs.notifyObservers(null, 'content-start', null);
Attachment #817707 - Attachment is obsolete: true
Attachment #8360145 - Attachment is obsolete: true
s/vingetun/vingetetun/, sorry!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Yeah we changed the way suggestions work last month. Probably fixed it.
Flags: needinfo?(dflanagan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: