Closed Bug 1979764 Opened 1 year ago Closed 11 months ago

history_sync::fetch_outgoing takes 2.6 seconds on my phone

Categories

(Application Services :: Sync, defect, P2)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mstange, Assigned: skhamis)

References

Details

(Whiteboard: [fxsync-])

Attachments

(1 file)

I happened to catch some Sync activity when I was profiling Fenix startup on my personal phone: https://share.firefox.dev/46xnQfE

It's spending 2.6 seconds running the following query:

        let places_sql = format!(
            "
            SELECT guid, url, id, title, hidden, typed, frecency,
                visit_count_local, visit_count_remote,
                last_visit_date_local, last_visit_date_remote,
                sync_status, sync_change_counter, preview_image_url,
                unknown_fields
            FROM moz_places
            WHERE (sync_change_counter > 0 OR sync_status != {}) AND
                  NOT hidden
            ORDER BY frecency DESC
            LIMIT :max_places",
            (SyncStatus::Normal as u8)
        );

Is it expected to have to read so much data from disk during this query?

This shouldn't really happen "during" startup - the app should delay this sync a little, at least a few seconds after the app has started. That sounds like a Fenix problem.

But more generally, I really don't think we'd expect 2.6 seconds here unless you had a massive amount of new history (eg, it might make sense for the very first sync). I guess this might be doing a full table scan though, which we should diagnose.

Severity: -- → S2
Priority: -- → P2
Whiteboard: [fxsync-]

(In reply to Mark Hammond [:markh] [:mhammond] from comment #1)

This shouldn't really happen "during" startup - the app should delay this sync a little, at least a few seconds after the app has started.

Yes, and this is working - the profile shows that it started 7.6 seconds after process start. I was just profiling long enough that the activity happened to be captured. And the link in comment 0 shows a subrange of the profile which I zoomed into.

But more generally, I really don't think we'd expect 2.6 seconds here unless you had a massive amount of new history (eg, it might make sense for the very first sync). I guess this might be doing a full table scan though, which we should diagnose.

I have succeeded in exfiltrating my profile data from the phone (see bug 1808763 comment 5), so we can inspect the database contents.

Assignee: nobody → skhamis
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Flags: qe-verify+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: