Closed
Bug 921685
Opened 11 years ago
Closed 11 years ago
contacts auto-detection of "rows per screen" causes sync reflow
Categories
(Firefox OS Graveyard :: Gaia::Contacts, defect, P1)
Tracking
(blocking-b2g:koi+, b2g-v1.2 fixed)
Tracking | Status | |
---|---|---|
b2g-v1.2 | --- | fixed |
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
(Keywords: perf, Whiteboard: [c=progress p=3 s= u=1.2])
Attachments
(1 file)
While profiling bug 914913 I noticed that we are triggering a sync reflow during load due to the code that auto-detects the number of rows that will fit in a single page on the device. This is due to getBoundingClientRect() in appendToList(). The reflow is fairly small and contained, taking about 10ms to 20ms, but it would be nice to remove it if we could. I'm not sure what to do about this one. It seems detecting the page size is a legitimate thing to do given that we have devices with different dimensions. The most reliable way to do this is based on the final calculated CSS style. Perhaps we could set a "minimum page size" reflecting our smallest handsets and defer calculating the true rowsPerPage value until we've rendered at least that many contacts. This could at least help our time to display the first page of contacts on these smaller handsets. I'm open to other suggestions too.
Comment 1•11 years ago
|
||
could we do this with window.innerHeight or via a prefilled value at build time?
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Jose M. Cantera from comment #1) > could we do this with window.innerHeight or via a prefilled value at build > time? So its not the determining the viewport size that is the issue, but instead determining how large each row is. We can either get the row size specifically or the full list size and then divide by number of rows, but either way we cause a sync flush in order to calculate the actual size. (Row vs full list should be pretty equivalent at the moment, by the way, because we do it when we only have one item in the row.) Prefilled at build time would be possible, but would be kind of a pain for testing. I suppose we could cache it in the cookie along with the list ordering. On its own that would seem a bit over the top, but since we're looking at the cookie anyway...
Assignee | ||
Comment 3•11 years ago
|
||
Taking this one to try to further improve 914913. I'm going to pursue the cookie path since we already have a config value stored there. Since the geometry of the device is fixed we should only have to pay the sync reflow price once.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•11 years ago
|
||
Work in progress on this branch. https://github.com/wanderview/gaia/compare/contacts-size-reflow?expand=1 So far I have just refactored the cookie code a bit to allow me to insert additional values.
Assignee | ||
Comment 6•11 years ago
|
||
Work-in-progress branch has been updated. This appears to be working and I've verified in the profiler that the sync reflow is avoided. Just need to clean up for review.
Updated•11 years ago
|
blocking-b2g: koi? → koi+
Whiteboard: [c= p= s= u=] → [c=progress p= s= u=1.2]
Updated•11 years ago
|
Priority: -- → P1
Assignee | ||
Comment 7•11 years ago
|
||
This pull request avoids the sync reflows from rowsPerScreen detection by storing detected value in the cookie.
Attachment #821205 -
Flags: review?(jmcf)
Comment 8•11 years ago
|
||
Hi Ben, The PR is in good shape, though I left some comments on Github.
Assignee | ||
Comment 9•11 years ago
|
||
Thanks Jose. I've updated the pull request based on your suggestions. Let me know what you think.
Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 821205 [details] [review] Pull request at https://github.com/mozilla-b2g/gaia/pull/13043 Moving the r? to Francisco since Jose is out on PTO.
Attachment #821205 -
Flags: review?(jmcf) → review?(francisco.jordano)
Assignee | ||
Updated•11 years ago
|
Whiteboard: [c=progress p= s= u=1.2] → [c=progress p=3 s= u=1.2]
Comment 11•11 years ago
|
||
Just to note I'm back and could resume the review if you agree thanks
Comment 12•11 years ago
|
||
Comment on attachment 821205 [details] [review] Pull request at https://github.com/mozilla-b2g/gaia/pull/13043 Great job, as always.
Attachment #821205 -
Flags: review?(francisco.jordano) → review+
Assignee | ||
Comment 13•11 years ago
|
||
(In reply to Jose M. Cantera from comment #11) > Just to note I'm back and could resume the review if you agree I was out yesterday, so didn't see this till now. I'm going to go ahead and run with Francisco's r+ unless you have any objections. Thanks to you both! Merged: https://github.com/mozilla-b2g/gaia/commit/c434b919b2859d0284a935efaf5660b160bdf3b3
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 14•11 years ago
|
||
Uplifted to v1.2 branch: https://github.com/mozilla-b2g/gaia/commit/1bc6de4f21f66bd8e931be36fc2ba9f99dae3732
status-b2g-v1.2:
--- → fixed
Updated•11 years ago
|
Target Milestone: --- → 1.2 C4(Nov8)
You need to log in
before you can comment on or make changes to this bug.
Description
•