Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow rendering of Ransack form #154

Closed
iRonin opened this issue Oct 29, 2012 · 8 comments
Closed

Slow rendering of Ransack form #154

iRonin opened this issue Oct 29, 2012 · 8 comments

Comments

@iRonin
Copy link

iRonin commented Oct 29, 2012

I'm experiencing performance issues when rendering Ransack form.
It takes 1.8-3.5s to render the form.
Is there anything I should look into in order to improve it?

@radar
Copy link
Contributor

radar commented Oct 29, 2012

Please provide steps to reproduce this problem.

On 29/10/2012, at 19:29, Cyprian notifications@github.com wrote:

I'm experiencing performance issues when rendering Ransack form.
It takes 1.8-3.5s to render the form.
Is there anything I should look into in order to improve it?


Reply to this email directly or view it on GitHub.

@iRonin
Copy link
Author

iRonin commented Oct 29, 2012

I guess I would have to send the data and the code and this is not something I can do.

I measured the times required to render particular form's elements and I can see they are quite long.
It's not possible to cache form fragment since Ransack renders the preselection (and it would have to create cache for each search criteria permutation).
I'm just trying to figure out whether it's default behaviour or there is something wrong with the data model on Ransack's configuration.

@radar
Copy link
Contributor

radar commented Oct 29, 2012

Please look into ways to replicate this on a new app. There has to be a way.

On 29/10/2012, at 20:57, Cyprian notifications@github.com wrote:

I guess I would have to send the data and the code and this is not something I can do.

I measured the times required to render particular form's elements and I can see they are quite long.
It's not possible to cache form fragment since Ransack renders the preselection (and it would have to create cache for each search criteria permutation).
I'm just trying to figure out whether it's default behaviour or there is something wrong with the data model on Ransack's configuration.


Reply to this email directly or view it on GitHub.

@konung
Copy link

konung commented Oct 30, 2012

Besides that make sure you are not doing something like Product.all on a select dropdown where Prodoct.count > 100.
I ran into something like that the other day - couldn't figure out why IE hangs and Chrome takes forever to refresh the page.
My Product table holds 20,000 items

@ndbroadbent
Copy link
Contributor

We are also experiencing slow render times while using the predicate_select and attribute_select helpers. This is on the open source fat_free_crm project.

Someone reported the problem on our mailing list, and attached some logs: https://gist.github.com/4030428.
(We are using predicate_select and attribute_select in the _condition_fields.html.haml and _grouping_fields.html.haml partials.)

Was wondering if you would have any ideas about how to speed this up?

@ndbroadbent
Copy link
Contributor

His post also included a New Relic screenshot showing that SQL SHOW is probably causing the issue. Maybe some caching is needed somewhere?

New Relic Screenshot

@steveyken
Copy link

There's a bit more context about this issue in the fat_free_crm issue tracker fatfreecrm/fat_free_crm#260 . Looks like it could be translation related. Has anyone had chance to track this done? I'm hoping to take a look but welcome collaboration. I love Ransack but this is killing performance - upwards of 5 seconds for us. Regards, Steve

@scarroll32
Copy link
Member

If still an issue could you please re-open with a repo / failing test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants