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

Sort filters are sometimes applied multiple times #7388

Closed
tsteur opened this issue Mar 8, 2015 · 0 comments
Closed

Sort filters are sometimes applied multiple times #7388

tsteur opened this issue Mar 8, 2015 · 0 comments
Assignees
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Mar 8, 2015

Often in Reporting API's we do sort the just built dataTable like this:

This results in slower performance as we might sort the dataTable twice if a filter_sort_column is specified. This is for example the case when requesting reports for the UI. On a table with 25k rows this can easily add another second execution time as our custom sort function will be executed > 1 million times each time we sort.

Ideally, the report class would define the default sort column and we would sort max once if needed at all. For example we can pass the report object to DataTableGenericFilter and get the default sort column(s) and default sort parameters from the report.

Alternatively, we could not sort a dataTable at all but only if a user specifically specifies a filter_sort_column. I do not think that this would break the API as we have not defined any default sort column in the documentation etc. This would be much easier.

@tsteur tsteur added the c: Performance For when we could improve the performance / speed of Matomo. label Mar 8, 2015
@tsteur tsteur closed this as completed Apr 8, 2015
@tsteur tsteur added this to the Piwik 2.13.0 milestone Apr 8, 2015
@tsteur tsteur self-assigned this Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Projects
None yet
Development

No branches or pull requests

1 participant