pebble-dev / rebblestore-api

Rebble Store api code.
MIT License
39 stars 8 forks source link

Moved collection sorting to SQL - About 2x faster #27

Closed azertyfun closed 6 years ago

azertyfun commented 7 years ago

As suggested by phpeter in #25.

By leaving the sorting to SQL, getting the Faces collection went from ~500 ms to ~220 ms on my i7 4790K.

It could be improved by doing in-query pagination (but that requires SQL wizardry, especially with SQLite).

Only doing the sorting on the relevant applications required some imagination (using a IN selector, and building and concatening a list manually). That is because each collection stores its own list of applications, but SQLite can't handle lists so we have to do that in Go.