wallabag/src/Wallabag/ApiBundle
Kevin Decherf 19802d8bd5 Improve performance of REST exists call
I've noticed that the endpoint `/api/entries/exists` used by the "Sweep
articles" feature on the Android app failed almost all the time on my
instance.

After checking the corresponding method I found that
`EntryRestController::getEntriesExistsAction()` could be improved.

Here is the former way the method worked:

```
for id in [list of ids]
  get full entry by id
  if null
    get full entry by given id

return array of ids or array of hashes
```

With this behavior on my instance I could expect up to 13k SQL requests
when sweeping articles from the Android app. Morever the repository
fetches all fields (content included) while the method only returns ids
or hashes.

The new behavior is described as follow:

```
get ids, hashes by [list of ids]
merge with provided [list of ids] // this part will complete the final
                                  // array with not found ids

return array of ids or array of hashes
```

In my case this change reduces the number of SQL requests to only 135
(_considering one request for 50 articles_)

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2021-08-05 23:19:08 +02:00
..
Controller Improve performance of REST exists call 2021-08-05 23:19:08 +02:00
DependencyInjection [#1604] First draft to fix SensioLabsInsight report 2016-01-22 21:12:11 +01:00
Entity Cascade delete on oauth2 table when deleting a user 2019-05-10 20:36:45 +02:00
Form/Type Force default_protocol to generate an url input 2019-02-08 15:03:52 +01:00
Repository Cast client id to avoid PG error 2019-01-09 23:31:14 +01:00
Resources/config Add ability to import/export tagging rules 2019-07-08 09:38:32 +02:00
WallabagApiBundle.php * public registration 2015-10-03 13:30:43 +02:00