Postpone searches for half a human moment
AbandonedPublic

Authored by leinir on May 8 2017, 2:44 PM.

Details

Reviewers
apol
Summary

We currently postpone searches 200ms, but as this causes a great deal of online traffic, and no small amount of visual clutter (a whole lot of items appearing and disappearing very rapidly), the proposal is to postpone the search for one and a half seconds.

nb: This might seem an arbitrary number, but given the psychological effect that three seconds seems to be what humans consider a moment (and in the case of waiting for something to happen, a moment is that time when you think "this is taking a bit long, isn't it?"), the idea is to postpone for half of such a conceptual moment. See also https://www.psychologytoday.com/blog/all-about-addiction/201101/tick-tock-tick-hugs-and-life-in-3-second-intervals (i'm afraid the actual paper is hidden behind an academic paywall)

Diff Detail

Repository
R134 Discover Software Store
Lint
Lint Skipped
Unit
Unit Tests Skipped
leinir created this revision.May 8 2017, 2:44 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 8 2017, 2:44 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
markg added a subscriber: markg.May 8 2017, 4:37 PM

I don't think adding a (rather massive) delay is the real fix here. It only masks the actual issue.

What really happens (just opened the discover store for the first time ever) is that entries can flow in at any point, that might be an issue.
Every batch can contain items for any position in the in the store.

The query used to fetch the data should fetch it in order of appearance. That would fix the visual clutter issue you described.

Secondly (but this is outside the scope of this report) it should probably implement a incremental loading logic. Right now it seems to fetch everything.

leinir added a comment.May 8 2017, 4:53 PM
In D5767#108088, @markg wrote:

I don't think adding a (rather massive) delay is the real fix here. It only masks the actual issue.

What really happens (just opened the discover store for the first time ever) is that entries can flow in at any point, that might be an issue.
Every batch can contain items for any position in the in the store.

The query used to fetch the data should fetch it in order of appearance. That would fix the visual clutter issue you described.

Secondly (but this is outside the scope of this report) it should probably implement a incremental loading logic. Right now it seems to fetch everything.

I think you might be misunderstanding the base intention of postponing the search here... We do not have a giant data centre to host the kde store, where the search goes to, so we can't simply afford to swallow the many unneeded requests the existing delay causes. This is a part of a wider effort to ensure we only send requests to that server that we actually intend to make. You are correct, however, that this is in no way enough on its own, but we already caused a manual ddos on api.kde-look.org week before last, which caused a shutdown for about a day, and if we can avoid that in the future, we need to do so. This helps (only sends searches we want), but we do also need to batch and combine the searches (which needs to happen elsewhere, and as you say is outside the scope of this patch).

apol edited edge metadata.May 8 2017, 9:27 PM

It could make sense to move this to the KNSBackend, any appstream-based backends don't have such a problem.

leinir added a comment.May 8 2017, 9:30 PM
In D5767#108234, @apol wrote:

It could make sense to move this to the KNSBackend, any appstream-based backends don't have such a problem.

Good point indeed - while it isn't really kns specific, we don't have any other backends that go online to do any searching at the moment, so... yeah, i'll prepare a new patch with that in mind (i'll update this revision with the new patch, as the problem and (most of) the solution is the same, just in a different location)

jensreuterberg added a subscriber: jensreuterberg.EditedMay 9 2017, 10:01 AM

Sry for seeming obtuse here but isn't the results from previous queries saved between sessions and displayed for the search?

I mean I see that when doing a search within "Plasma Addons" you get the left hand column bouncing around since it loads all the categories? Shouldn't at least that be saved and just edited if something has actually changed?

apol added a comment.May 9 2017, 10:44 AM

Sry for seeming obtuse here but isn't the results from previous queries saved between sessions and displayed for the search?

I mean I see that when doing a search within "Plasma Addons" you get the left hand column bouncing around since it loads all the categories? Shouldn't at least that be saved and just edited if something has actually changed?

Not really, we don't save past searches. Maybe we should. We don't have changed information from OCS.

apol requested changes to this revision.May 27 2017, 3:18 PM

Bump?

This revision now requires changes to proceed.May 27 2017, 3:18 PM
leinir abandoned this revision.Jun 15 2017, 9:50 AM

Incidentally, because KNS itself will already postpone non-cached searches by one second, the new proposed solution above (to only to this for KNS sources) is already implemented by way of using D6191