Page MenuHomePhabricator

Investigate how well cached 60px and 120px thumbnails are
Closed, ResolvedPublic

Description

And also while we're at it, if there is a size "nearby" that has much better hit ratio and/or swift presence (150px maybe?).

Event Timeline

Gilles created this task.Dec 2 2016, 10:03 PM
Gilles added a comment.EditedDec 2 2016, 10:40 PM

Found this breakdown of thumbnail sizes in swiftthat had been done some time ago: https://phabricator.wikimedia.org/T65440#1448815

120 is an excellent choice, it's the most common thumbnail size. 60px is quite low in the ranking but still in the top 50. 48px (3rd most used) would be a much better option, though, in that "area". There are roughly ten times more 48px thumbnails than 60px, which means a 48px request is 10 times more likely to be a hit than a 60px. If you need slightly bigger, 75px is your next best choice.

Gilles added a comment.Dec 3 2016, 8:31 AM

Did you mean to tag yourself? :)

Mhurd added a comment.Dec 4 2016, 7:19 AM

haha i gotta remember to just tap the subscribe button :)

Gilles closed this task as Resolved.Dec 6 2016, 12:30 AM

There isn't more to investigate, imho. I'd recommend you use either 48px or 75px instead of 60px to increase performance.

Found this breakdown of thumbnail sizes in swiftthat had been done some time ago: https://phabricator.wikimedia.org/T65440#1448815

I've ran the numbers again today and the resulting json is P4577, it'll need a bit of json-love but it contains a breakdown by size of bytes and number of thumbnails

Krinkle added a subscriber: Krinkle.EditedDec 7 2016, 4:54 AM

I've ran the numbers again today and the resulting json is P4577, it'll need a bit of json-love but it contains a breakdown by size of bytes and number of thumbnails

Updated P4577. Sorted using jq :-)

Top 10:

BytesPerSize
"2880": 11235128303234,
"1920": 5447599279713,
"1280": 5118964716716,
"1024": 4100381810363,
"2560": 3901237941485,
"800": 3687993251192,
"640": 2464623579198,
"1200": 2202060461083,
"1600": 1265417767891,
"320": 800856360021,
CountPerSize
"180": 35025828,
"120": 34662399,
"320": 27906299,
"800": 26438144,
"640": 26389242,
"240": 23411309,
"1024": 20756041,
"1280": 18169359,
"48": 15720077,
"300": 14666507,
"150": 13955179,
$ cat data.json | jq -r '.BytesPerSize | to_entries | sort_by(.value) | reverse | from_entries | { BytesPerSize: . }' > data-sorted-bytes.json
$ cat data.json | jq -r '.CountPerSize | to_entries | sort_by(.value) | reverse | from_entries | { CountPerSize: . }' > data-sorted-count.json
$ jq -s add data-sorted-* > data-sorted.json
$ wc -l data.json data-sorted.json 
  30638 data.json
  30638 data-sorted.json

Thanks @Krinkle, much more useful ! 😀

bearND added a subscriber: bearND.Dec 12 2016, 9:55 PM

When you talk about size you mean width, right?

@bearND correct, the size as it appears in the url before px