Closed Bug 936202 Opened 11 years ago Closed 11 years ago

adding a contact triggers a list sync reflow due to imgLoader.reload()

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bkelly, Assigned: bkelly)

References

Details

(Keywords: perf, Whiteboard: [c=progress p=1 s= u=])

Attachments

(1 file)

Currently, when a contact is added or modified we end up calling imgLoader.reload() in addToList().  This is an issue for two reasons:

  1) The call to imgLoader.reload() triggers a sync reflow on the list.
  2) This gets called once for each contact added during a large import.

To avoid this situation we can defer the imgLoader.reload() until the visibility monitor detects a change that effects our current onscreen view.  Since the visibility monitor is smart enough to ignore contacts added below the current screen, this avoids a lot of sync reflows.

(We might want to open another bug to replace imgLoader altogether in favor of performing the logic from visibility monitor.)
Jose, this pull request avoids a large number of sync reflows during the import process.  It does this by deferring the imgLoader.reload() call until the visibility monitor confirms that our onscreen view has been modified.
Attachment #828902 - Flags: review?(jmcf)
Note, this also includes not calling FixedHeader.refresh() in addToList().  This call is not needed here because the header is refreshed in showGroupByList().  This also helps with imports since performing the query selector on large DOM lists for each contact can get slow.
Blocks: 936215
Attachment #828902 - Flags: review?(jmcf) → review+
Please, nom it to 1.3 if you consider it

thanks
Thanks for the review.  Travis is green except for an unrelated marionette failure in media playback.  Landed:

  https://github.com/mozilla-b2g/gaia/commit/dcdf1c525be784eb506ab06c523f5b0ef9b461d6

Jose, since master is 1.3, what does nom'ing for 1.3? do right now?
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: