apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Categories suggestions slow to appear

Open nicolas-raoul opened this issue 3 years ago • 4 comments

Context

Category suggestions are gathered like this:

  • A) Find categories that are connected to the depictions that have been selected in the previous step.
  • B) Find categories of existing Commons pictures whose coordinates are close by.
  • C) Past selected categories
  • D) (there may be more that I forgot)

Problem

Steps to reproduce:

  1. Start a multi-upload of 20 pictures that have roughly the same longitude/latitude in their JPG EXIF metadata (it can be dummy pictures as you won't need to finalize the upload).
  2. Select a few depictions.
  3. Problem: At the categories activity, it take around 1 minute for category suggestions to appear.

When doing the same with only 1 picture, it takes only a few seconds.

I suspect that the app performs 20 times the tasks listed in the "context" section above, especially the first two tasks.

Suggested solution

A) For categories that are connected to the depictions that have been selected in the previous step, this should only happen once, as all pictures have the same depictions in a multi-upload. This might actually be correctly implemented already, please check. B) Before finding categories of existing Commons pictures whose coordinates are close by, the app should "cluster" the pictures that are close enough. A basic implementation could be skip a search if there already (in the same multi-upload) was a search for coordinates within 50 meters. A smarter implementation could "cluster" the 20 locations to minimize the number of web queries.

nicolas-raoul avatar Sep 29 '23 06:09 nicolas-raoul

Hi @nicolas-raoul, I'd like to work on this.

I tried it on my phone with 20 pictures taken at the same spot and the same caption copied to all of them. The app searches categories for that caption 20 times, one after another, so the categories screen keeps loading for about 20 s. It also looks up the same location 10 times.

What I'd do:

  1. Search each caption only once.
  2. Skip the location lookup if this upload already looked up a place within 50 m, like you suggested.
  3. If one search fails, keep the results of the others (right now one failure hides all suggestions).

I tried this on my phone: 1 search instead of 20, the loading stops after about 2 s instead of 20 s, and 1 location lookup instead of 10.

Can I work on this?

Medhansh-741 avatar Nov 24 '26 19:11 Medhansh-741

Assigned to you, @Medhansh-741! Thanks!

nicolas-raoul avatar Nov 24 '26 19:11 nicolas-raoul

@nicolas-raoul opened #7420 for this. With the same 20 pictures the categories screen now loads in about 2 s instead of 20 s, the caption is searched once and the location is looked up once.

Medhansh-741 avatar Nov 24 '26 21:11 Medhansh-741

Yes, fantastic improvement, thanks @Medhansh-741!

nicolas-raoul avatar Nov 28 '26 09:11 nicolas-raoul