In our app, we are using "custom filtering", as we set our own function in the "operator" property of the filter.
I found, that, every operator is called twice. If I have 10 rows to filter, and 1 operator set for 1 specific filter, it runs 20 times, from 1 to 10, and again from 1 to 10.
Steps to reproduce:
After some investigation, I found this:
In your "query" function, you run this:
(copied from the minified version + chrome prettyPrint in F12)
result = this._queryProcess(this._data, this._mergeState(options));
The filter is applied.
Then, a few lines later, that:
this._aggregateResult = this._calculateAggregates(this._data, options);
And, from that line, the whole filtering is applied again.
When we have only a few lines to filter, it's quick.
But with 5000 rows of 10 filters per row, running it twice is a good difference in cpu, memory and time!
You can look at my dojo sample, it's easy to reproduce.