active_admin-sortable_tree icon indicating copy to clipboard operation
active_admin-sortable_tree copied to clipboard

improve resource loading performance when updating

Open atitan opened this issue 7 years ago • 3 comments

The original creates a lot of N+1 queries when collection set is large.

Query everything in the first place and assign them.

atitan avatar Aug 21 '18 06:08 atitan

Nice! Is there a maximum number of records where performance degrades?

zorab47 avatar Aug 28 '18 01:08 zorab47

Currently we have 300+ categories listing as a tree. It takes about 15~20 seconds to update for every single drag in the admin panel.

I was able to cut it down to 2 seconds with this patch.

atitan avatar Aug 30 '18 03:08 atitan

Making the method of loading records configurable could work, but loading all records shouldn't be the default.

On Wed, Aug 29, 2018 at 22:32 Sh Lin [email protected] wrote:

Currently we have 300+ categories listing as a tree. It takes about 15~20 seconds to update for every single drag in the admin panel.

I was able to cut it down to 2 seconds with this patch.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zorab47/active_admin-sortable_tree/pull/77#issuecomment-417178706, or mute the thread https://github.com/notifications/unsubscribe-auth/AABiBjEYPdoGvh2cCfRUE4FS3IFAxiCmks5uV1y5gaJpZM4WFNIr .

zorab47 avatar Sep 02 '18 01:09 zorab47