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

optimize filtering #30

Closed
milianw opened this issue Feb 27, 2017 · 3 comments · Fixed by #308
Closed

optimize filtering #30

milianw opened this issue Feb 27, 2017 · 3 comments · Fixed by #308

Comments

@milianw
Copy link
Member

milianw commented Feb 27, 2017

The current filtering is not as efficient as it could be. Most notably, we concatenate the symbol+binary strings. Instead we should:

  • inherit from QSortFilterProxyModel
  • in its filterAcceptsRow overload, ask the model directly whether it matches the given needle
  • in the model, check against the symbol contents

Note that we cannot simply return a Data::Symbol variant, as that would still allocate the data on the heap for type erasure.

@GitMensch
Copy link
Contributor

Is the "concatenate symbol + binary strings" still true?

@milianw
Copy link
Member Author

milianw commented May 25, 2021

yes, see e.g. treemodel.h:


        if (role == FilterRole) {
            // TODO: optimize
            return QString(Util::formatSymbol(item->symbol, false) + item->symbol.binary);

@GitMensch
Copy link
Contributor

Then #292 seems to be related performance wise (at least for the "filter out (only this) binary").

lievenhey added a commit that referenced this issue Aug 9, 2021
this patch removes the filter role from AbstractTreeModel and adds a
QSortFilterProxyModel named CostProxy to remove memory allocations while
filtering

closes #30
lievenhey added a commit that referenced this issue Aug 10, 2021
this patch removes the filter role from AbstractTreeModel and adds a
QSortFilterProxyModel named CostProxy to remove memory allocations while
filtering

closes #30
lievenhey added a commit that referenced this issue Aug 12, 2021
this patch removes the filter role from AbstractTreeModel and adds a
QSortFilterProxyModel named CostProxy to remove memory allocations while
filtering

closes #30
lievenhey added a commit that referenced this issue Aug 13, 2021
this patch removes the filter role from AbstractTreeModel and adds a
QSortFilterProxyModel named CostProxy to remove memory allocations while
filtering

closes #30
lievenhey added a commit that referenced this issue Aug 13, 2021
this patch removes the filter role from AbstractTreeModel and adds a
QSortFilterProxyModel named CostProxy to remove memory allocations while
filtering

closes #30
milianw pushed a commit that referenced this issue Aug 16, 2021
this patch removes the filter role from AbstractTreeModel and adds a
QSortFilterProxyModel named CostProxy to remove memory allocations while
filtering

closes #30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants