mfinkle and I were discussing browser DB perf today, and whether it was worth 
exploring improvements (e.g., free-text indexing, better representations, query 
tuning).

I added some logging (the precursor of telemetry for this: Bug 1021922) and did 
some trivial timing on my phone.

The phone: HTC One M7. Quad-core 1.7GHz, 2GB RAM. This is last year's top 
model, still a relatively high-spec phone.


I set up Sync versus my real desktop data (a few hundred bookmarks, normal 
desktop history) and let it complete.

Launching Fennec spams this (as we add default data and thus have to reload the 
cursor):

06-06 18:22:00.331 D/GeckoTopSitesPanel(24012): TopSitesLoader.loadCursor() 
took 198msec.
06-06 18:22:00.821 D/GeckoTopSitesPanel(24012): TopSitesLoader.loadCursor() 
took 86msec.
06-06 18:22:01.101 D/GeckoTopSitesPanel(24012): TopSitesLoader.loadCursor() 
took 204msec.
06-06 18:22:01.562 D/GeckoTopSitesPanel(24012): TopSitesLoader.loadCursor() 
took 129msec.

Typing "bug":

06-06 18:23:24.470 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
194msec.
06-06 18:23:24.741 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
62msec.
06-06 18:23:24.821 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
52msec.

Typing "wiki":

06-06 18:23:40.407 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
193msec.
06-06 18:23:40.648 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
69msec.
06-06 18:23:41.038 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
69msec.
06-06 18:23:41.719 D/GeckoSearchLoader(24012): SearchLoader.loadCursor() took 
73msec.

Hitting Home then re-loading (showing Top Sites again):

06-06 18:26:12.450 D/GeckoTopSitesPanel(24012): TopSitesLoader.loadCursor() 
took 135msec.



So: a one-character match (which ends up as a view/table walk) takes about 
200msec, and every character thereafter updates in less than 100msec (but we're 
not smart about that: Bug 979121).

Loading Top Sites with a totally warm cache takes 135msec (plus processing 
time, favicons, etc. etc., which is why the wall clock times are about double 
the reported cursor load times).

A clean profile -- no data at all -- takes somewhere around 30-80msec to do the 
same queries with zero results. Some of that is fixed overhead, and some is 
query parsing and planning that we can improve.

In my opinion: quarter-second+ responsiveness for top sites and for searches, 
on a high-end phone (with no add-ons, no other big DBs, just non-trivial 
browsing data) means we have opportunities for improvement, especially on 
low-end devices. The gap between <100msec and 250msec+ is enough to turn 
"snappy" into "acceptable", or "acceptable" into "annoyingly slow".

I did not even attempt this with a low-end ARMv6 phone: not enough space. 
Telemetry will give us a broader picture there. But it's probably fair to 
double, or worse, particularly on devices that don't have a surfeit of cores 
and fast memory (more contention).

I don't know how accurate my timing points are; async cursor loading makes it 
kinda challenging to say exactly when work finishes. That'll come up in review, 
no doubt!

-R
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to