Closed Bug 1552948 Opened 6 years ago Closed 5 years ago

Uploads pagination is potentially slow

Categories

(Tecken :: General, task, P3)

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: willkg, Unassigned)

Details

From https://github.com/mozilla-services/tecken/issues/1519

Peter wrote:

The pagination of uploads is currently done the naive way of using batch size and pages. Here and here.
https://github.com/mozilla-services/tecken/blob/a89791f9e5ac73c1ed1188d8c6a588769d756a7d/tecken/api/views.py#L392-L394
https://github.com/mozilla-services/tecken/blob/a89791f9e5ac73c1ed1188d8c6a588769d756a7d/tecken/api/views.py#L448

The pagination would a lot efficient if we know the last row of the page. Then we could do...

for thing in queryset.filter(key__lt=previous_key_value)[:batch_size]:
    ...

instead of

for thing in queryset.filter(key__lt=previous_key_value)[start:end]:
    ...

Moving to Tecken product.

Component: Tecken → General
Product: Socorro → Tecken

I'm not hearing anyone mention slowness on this page, so for now let's make it a P3.

Priority: -- → P3

I'm looking at timings for this view and I don't think it's slow. One thing I am noticing is that since the React app refreshes the uploads every like 5 seconds, it makes a ton of requests that don't seem very useful.

I think I'm going to mark this as WORKSFORME.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.