history_sync::fetch_outgoing takes 2.6 seconds on my phone
Categories
(Application Services :: Sync, defect, P2)
Tracking
(Not tracked)
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?
Comment 1•1 year ago
|
||
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.
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
•
|
||
(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.
Comment 3•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Comment 4•11 months ago
|
||
Authored by https://github.com/skhamis
https://github.com/mozilla/application-services/commit/eec281291fcf391d7a985452f17c6509d8d54144
[main] Bug 1979764: Use partial index to speed up slower places queries (#6906)
Description
•