@tsteur opened this Pull Request on July 28th 2015 Owner

fixes #7401

Made sort faster by using builtin php methods. Currently, we sort via usort in PHP. This is quite slow especially when we sort many rows, eg 25k rows or more. The time needed to sort depends a lot on the data, the column to sort, etc. that's why it is hard to say how much performance improvement we will gain. On 25k rows it can drop from eg before about 900ms to 500ms.

As a side effect the code is much better tested and it does now use a secondary column on either nb_visits or label if possible see #7401

The sort flags SORT_NATURAL and SORT_FLAG_CASE were added in PHP 5.4 which this pull request requires, therefore this goes into Piwik 3.0

Original PR was made in #7420

refs #4768

@tsteur commented on July 29th 2015 Owner

FYI: Need to rerun test once the UI test run on PHP 5.4 in this branch

@tsteur commented on July 29th 2015 Owner
@tsteur commented on July 30th 2015 Owner

The tests in SortTest that were in original PR were already merged previously. There are tests for Sorter class now to make sure it works as expected. The sort filter itself does not really contain any logic so did not add more tests as there are already

This Pull Request was closed on August 18th 2015
Powered by GitHub Issue Mirror