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

clearing search bar with a large database is slow #8665

Closed
mixxxbot opened this issue Aug 23, 2022 · 7 comments
Closed

clearing search bar with a large database is slow #8665

mixxxbot opened this issue Aug 23, 2022 · 7 comments
Labels
Milestone

Comments

@mixxxbot
Copy link
Collaborator

Reported by: Be-ing
Date: 2016-10-20T02:18:32Z
Status: Fix Released
Importance: Medium
Launchpad Issue: lp1635087


From http://www.mixxx.org/forums/viewtopic.php?p=29623#p29623:
"I've learned to NEVER click the X button in the library search. It wants to re-sort the world every time. I give the field focus, hit ctrl-A to select all the text, and start typing."

Confirmed by another user here: http://mixxx.org/forums/viewtopic.php?p=30520#p30520

@mixxxbot mixxxbot added the bug label Aug 23, 2022
@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2016-11-28T01:31:07Z


Looks like clearing via the X is equivalent to changing the search query 5 times:

Debug [Main]: WSearchLineEdit::onSearchTextCleared
Debug [Main]: WSearchLineEdit::slotTextChanged ""
Debug [Main]: WSearchLineEdit::triggerSearch ""
Debug [Main]: LibraryTableModel(0x7fafcfbf9600) select() took 2 ms 293
Debug [Main]: LibraryTableModel(0x7fafcfbf9600) select() took 2 ms 293
Debug [Main]: LibraryTableModel(0x7fafcfbf9600) select() took 2 ms 293
Debug [Main]: WSearchLineEdit::triggerSearch ""
Debug [Main]: LibraryTableModel(0x7fafcfbf9600) select() took 3 ms 293
Debug [Main]: LibraryTableModel(0x7fafcfbf9600) select() took 3 ms 293

Other than a few minor differences the code paths are identical (e.g. restoring the vertical bar position) so we can probably fix this by making it search for "" just once.

Odd that the workaround works, because it's functionally equivalent except for:

  • QLineEdit::clear()

  • WTrackTableView::restoreVScrollVarPosition() [1]

Compare the WTrackTableView::onSearchCleared vs. WTrackTableView::onSearch

[1] https://github.com/mixxxdj/mixxx/blob/master/src/widget/wtracktableview.cpp#L981

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2016-11-28T01:32:16Z


Oops, everything from "Odd that the workaround works, because it's functionally equivalent except for:" and below was an old draft.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2018-12-17T19:11:39Z


Instead of immediately triggering a search that returns all tracks of the (probably huge) library the debouncing timer should be engaged when clearing the search edit. This is an easy fix and would establish a consistent behaviour.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2018-12-17T19:21:25Z


#1947

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-12-17T20:24:50Z


The PR cann't fix the route cause of this bug. But it is also not the right bug to track the root cause so let's close it.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2018-12-17T21:34:29Z


Of course, it doesn't fix the bug. It just establishes a consistent behaviour. With the configurable debouncing timeout in 2.2 it actually becomes useful.

Clearing the box without starting the debouncing timer is not an option, because then the contents of the view might stay inconsistent forever.

The issue will finally be resolved once we no longer fetch the whole result set eagerly from the database.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.1.6 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant