I tried many optimisations but it's not fast as I want. I think Activeadmin is good to do a admin part fast but it's better do use something else when it become more complexe. I tried Smart Listing. It works well and it's more customizable.
Increase speed of ActiveAdmin
-
20-06-2023 - |
Question
In a rails application, ActiveAdmin is very slow. I realy need a performance boost and I need to keep filters.
I think the most consuming things are the filters and the drop down boxes. I see two options I can apply, cache and includes. So, I have two questions :
- Is it possible to apply joins or includes when active admin find data? I need to apply scopes on filters and on associations.
- Is it possible to apply cache on filter and on index?
This is an example for association. On a model, I have this :
class ProviderService < ActiveRecord::Base
belongs_to :service
belongs_to :provider_profile, foreign_key: :provider_profile_id
def display_name
[service.title, provider_profile.display_name].join(" - ")
end
end
Each time a name is displayed, it do a query. It's very long.
A bonus question : Is there other solutions to boost perf?
La solution
Autres conseils
I resolved same issue by adding indexes into database. Try the same.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow