Closed Bug 969996 Opened 10 years ago Closed 10 years ago

Reduce reflows on call log

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yor, Assigned: yor)

References

Details

Attachments

(1 file, 2 obsolete files)

46 bytes, text/x-github-pull-request
rik
: review+
Details | Review
Currently the call log generates one reflow per call log group,
as each group is rendered separately.

Reduce reflows by grouping multiple call log groups into a single
render.  Initial group size will be smaller to ensure responsive user
experience.
Blocks: 965316
Attached file Pull request (obsolete) —
Attachment #8372983 - Flags: feedback?(anthony)
Assignee: nobody → yor
Comment on attachment 8372983 [details] [review]
Pull request

It obviously makes the call log so much more reactive, good low hanging fruit!

I had a hard time understanding the logic because of the 'chunk' word having no meaning (and actually two). Could you please replace it with 'day'?

Here are some new name suggestions:
renderChunkArray -> renderSeveralDays
renderChunks -> daysToRender
FIRST_CHUNK_SIZE -> MAX_GROUPS_FOR_FIRST_RENDER
INCREMENTAL_RENDER_SIZE -> MAX_DAYS_TO_BATCH_RENDER

I'd also like to see some unit tests. And I left one comment in the Pull Request.
Attachment #8372983 - Flags: feedback?(anthony) → feedback-
Attachment #8372983 - Flags: feedback- → feedback?(anthony)
Comment on attachment 8372983 [details] [review]
Pull request

This looks very nice (and feels very good to get that tested).

I've left comments in the pull request.
One more thing needed is to check in each test that we are calling CallLog.renderSeveralDays the exact number of times we expect. You can spy that method with sinon. You have an exemple in the notifications tests in call_log_test.js.
Attachment #8372983 - Flags: feedback?(anthony)
Attached file Pull request
Attachment #8376046 - Flags: review?(anthony)
Attachment #8372983 - Attachment is obsolete: true
Comment on attachment 8376046 [details] [review]
Pull request

Bugzilla process notes for next time: Since we're still looking at the same pull request, you could have reused the first attachment when asking for review. Also, if you need to send a new patch, you should mark the previous iteration as obsolete.

Excellent! I've left two comments on small details in the pull request. Before landing this, we'll also need to squash all the commits.
Attachment #8376046 - Flags: review?(anthony) → review+
Attached file Squashed pull request (obsolete) —
Attachment #8376571 - Flags: review?(anthony)
I tried to squash the commits using the existing branch but couldn't do it.
I had to start a new branch to make it work, hence the new patch.  It has
exactly the same commits (but squashed into a single one).

Also, I don't have merge access to gaia.  Can you please do that once you
are ok with the patch?  Thanks!
Attachment #8376571 - Flags: review?(anthony)
Attachment #8376571 - Attachment is obsolete: true
Was able to squash the commits on the original patch.  Please merge.
Sorry for the delay, I had lots of other stuff to look at. Please use needinfo when you want someone to act on a bug, it sends reminders so people don't forget.

Actually, I'm not gonna merge yet because I still have some comments. I don't know why I didn't write those before, sorry :(
Updated unit tests based on your last comments.
Flags: needinfo?(anthony)
Status: NEW → ASSIGNED
Sorry for this, I was very busy last week and wasn't sure we could land this with the new landing policy.

I'll merge this since it greatly improves performance and it adds a bunch of unit tests for something that wasn't tested before.
Flags: needinfo?(anthony)
https://github.com/mozilla-b2g/gaia/commit/09519de9fc717be692a3983b041f24ad4fbda78c
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Depends on: 978682
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: