refinery/refinerycms — pull request #2746 by vladimir-tikhonov (2014-11-07 13:07:44+00:00)
Title: Speed up page reordering

`update_positions` and `update_child_positions` methods perform a lot of useless UPDATE queries. Pull request adds few checks to prevent this.

Some benchmarking (315 pages, https://gist.github.com/vladimir-tikhonov/7aea6077be29c38ab6f7):
__Before:__
> Click 'Reorder Pages' and then immediately 'Done Reordering Pages': __21981.7ms__
> Click 'Reorder Pages', mix pages for 5 seconds and 'Done Reordering Pages': __21779.1ms__

__After:__
> Click 'Reorder Pages' and then immediately 'Done Reordering Pages': __644.8ms__
> Click 'Reorder Pages', mix pages for 5 seconds and 'Done Reordering Pages': __2878.9ms__