Closed Bug 1184767 Opened 9 years ago Closed 9 years ago

Upweight local sites in Top Sites

Categories

(Firefox for iOS :: Home screen, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios + ---

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

(Whiteboard: noteworthy)

Attachments

(1 file)

47 bytes, text/x-github-pull-request
wesj
: review+
Details | Review
The bare minimum of Bug 1172072.
Attached file Pull req.
Attachment #8635008 - Flags: review?(wjohnston)
Comment on attachment 8635008 [details] [review]
Pull req.

We have a really bad test for timing these queries (i.e. time to add 10000 visits, time to query 10000 visits). It would be nice to update it and get some real numbers as we change/improve this stuff. Different bug though.
Attachment #8635008 - Flags: review?(wjohnston) → review+
Can you point me to the perf tests? The only thing I found was testGetPerformance in TestHistory, which only adds 10 sites with one visit each.

I would like to have a clue of what the top sites perf impact is from this change (and thus whether I should add an approximation or pre-calculation before landing), and not having to write those tests would be awesome :D
Flags: needinfo?(wjohnston)
I wrote a perf test. 500 sites, 20 local and 20 remote visits, fetching 10 sites by frecency 5 times.

Old, simulator: 0.070sec.
New, simulator: 0.140sec.
I think the perf difference is because the simpler query can use idx_visits_siteID_date as a covering index. So this should be pretty easy to fix.
Sorry, that is the perf test! I cut it down drastically at one point and never increased the timing, but it has enough bugs its just worth rewriting.
Flags: needinfo?(wjohnston)
Second round of changes looks good to me. We should remember to set a baseline in XCode once this is running automation. (Also, yay for more tests here!)
https://github.com/mozilla/firefox-ios/commit/bfc79a98856428da4e7b88f6e9c1ecfa735f822b

Yay commit message typo.

Note that I added an additional commit that upweights local sites super-quadratically, not linearly. That means a site you've visited four times on your phone counts as (4 * (5 + 4)) = 36 times on desktop.

The reason for this: many users' desktop top sites (like Twitter and Facebook) will have thousands of visits. Those won't all sync -- there's a limit of 20 visits in a Sync record -- but after a few weeks, hundreds of visits will have made it to the phone for active sites.

We can revisit the exact scoring algorithm as we get more experience.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
OS: iOS 8 → iOS
Resolution: --- → FIXED
Whiteboard: noteworthy
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: