Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Conversation

@jklausa
Copy link
Contributor

@jklausa jklausa commented Jun 3, 2019

Description

Fixes wordpress-mobile/WordPress-iOS#11657, ish.

The comments should explain it — but I was able to figure out that only fetching likes slows those requests down so much — fetching just views/visitors/comments is (relatively, still takes like ~1.5s of wall-clock time for a year) 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

@jklausa jklausa requested a review from ScoutHarris June 3, 2019 05:56
@jklausa jklausa self-assigned this Jun 3, 2019
Copy link
Contributor

@ScoutHarris ScoutHarris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with wordpress-mobile/WordPress-iOS#11841. Works great!

@jklausa jklausa merged commit bae644c into develop Jun 3, 2019
@jklausa jklausa deleted the feature/stats-fetch-likes-separately branch June 3, 2019 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Stats Refresh] investigate Period summary fetch time

3 participants