Homepage: Randomize the position of items #215
No reviewers
Labels
No Label
Priority
Critical
Priority
High
Priority
Low
Priority
Normal
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Type
Breaking
Type
Documentation
Type
Enhancement
Type
Feature
Type
Report
Type
Security
Type
Suggestion
Type
Testing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/extensions-website#215
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ui-home-randomize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Place items randomly on every page load so it is a bit more fair for everyone.
This is only for the 8 add-ons and themes in the homepage. It does not affect other listings since they have custom sorting.
I love the functionality.
Maybe @Oleg-Komarov wants to comment on the code approach?
What is the end goal of this?
I think on a lot of screens all the top 8 cards are visible, so shuffling them doesn't give more exposure to different items - the same ones are shown, just in different order.
Performance-wise, I don't mind this because shuffling the top-8 items in memory is cheap, but I wonder what kind of user behavior change do we expect?
If we have a hypothesis that the first 4 of the top cards get more visits, we can verify this looking at the access log data (before and after this change).
But if we don't have any particular expectations, I wonder why do this?
Current data for all visits (not deduplicated by user) for last 3 days for top 8 extensions:
Bool-tool is on the 3rd place in visits, but it is the last on the website.
A different idea may be to show completely random extensions every time.
The theory behind this would be to get a more uniform distribution of visits and ratings in the tail of the distribution.
What would be the value for the users in this? Accidentally come across an extension they didn't know they needed?
I'm not sure how to judge if that is valuable - we could see if more extensions get rated.
Implementing this would need slightly more code, I would probably test the following:
select all listed IDs, probably cache them in memory to avoid this select on every page view, and then do a
random.sample(cached_addon_ids, 8)
so on every page view we would get a random sample from the whole population of the listed add-ons.There are other ways to tackle this of course, but randomizing the already visible list I think it could help.
Yes. That's what the homepage is about, discovery.
I quite like the random sample idea!
Would it be expensive to get a slightly longer list, say 3 times the size of the ones displayed? I just pushed the following change:
(already discussed with @dfelinto that the homepage could show more add-ons than themes since they are more popular anyway).
This does a little bit of unnecessary extra work when constructing the objects (with all dependencies) that are then thrown away, but shouldn't be a big deal, I think.
It's possible to optimize it by fetching just the ids, sampling those, then fetching the objects, and shuffling them (because they will be always sorted when fetched by ids).
Let's deploy this and check the latency, we can optimize if needed.
tests are failing
We should add a check that we have enough items to sample from - the tests are failing because the number of test extensions is less than the hard-coded constants.
Oops sorry, my local db has more extensions than the sample required, and forgot to run the tests.
I've run the tests now and they run okay.
My fix was to get the minimum value between the desired sample size (8 add-ons, 4 themes) and the ones actually available.
NP, some day we should get a CI to run the tests automatically ;)
Thanks for finishing this!