Slow rendering of Ransack form #154

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

Comments

Projects
None yet
6 participants

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?

Member

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 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.

Member

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 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

Contributor

ndbroadbent commented Nov 15, 2012

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?

Contributor

ndbroadbent commented Nov 15, 2012

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 steveyken referenced this issue in fatfreecrm/fat_free_crm Jun 19, 2013

@steveyken steveyken Build sort if needed. 55f881e

steveyken referenced this issue in fatfreecrm/fat_free_crm Jun 28, 2013

Open

ransack_ui has horrible performance #260

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

Member

seanfcarroll commented May 24, 2017

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