This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Stats: separate out fetching "likes" from "Summary" for performance speedup. #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes wordpress-mobile/WordPress-iOS#11657, ish.
The comments should explain it — but I was able to figure out that only fetching
likesslows those requests down so much — fetching justviews/visitors/commentsis (relatively, still takes like ~1.5s of wall-clock time for ayear) fast.I tried bajilllion different things to work-around this in a nicer way — splitting data by a smaller chunk (i.e. instead of fetching by
.year, fetch 14 times by.month) and add data up ended up... much slower — not even because of the added complexity and additional parsing step, just the smaller requests sometimes were slower than the ones with bigger granularity.Adding to the fact that mobile networks aren't exactly friendly to firing multiple requests like that and it ended up being a very, very long and windy road to nowhere.
AFAICT, Calypso does the same thing — when I look at the request made in the network inspector, there's one that doesn't ask for likes and takes ~2s, and a second one that loads likes that's taking up ~10x times that.
Testing Details