RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
892 stars 262 forks source link

Replace kaminari with pagy #650

Open brunoocasali opened 3 years ago

brunoocasali commented 3 years ago

Scope / difficulty

[medium] Replace kaminari with pagy in grape API.

Impact

Actually the kaminari implementation is easy to plug and play, but it have some disadvantages because it generates tons of objects in memory. The pagy implementation from the other side is small and consumes less memory. You can learn more about it here:

I think we could improve a lot the api timings with this change

DeeDeeG commented 3 years ago

Sounds like a good idea! API responsiveness and memory usage are definitely important for this web app. Thank you for the suggestion.

GPrimola commented 3 years ago

@brunoocasali have you used/considered will_paginate?

brunoocasali commented 3 years ago

Actually not, because pagy seems to be the best option to do this job, you can see on the links I've included in the description.

Do you have any experience comparing both on a real production workload, @GPrimola ?

GPrimola commented 3 years ago

No @brunoocasali , I just have experience with will_paginate.