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

dact very unresponsive if Sentences widget is used and there are many hits #123

Open
gertjanvannoord opened this issue Oct 9, 2013 · 3 comments

Comments

@gertjanvannoord
Copy link
Member

if you use the Sentence tab, and there are many hits (from 10 thousand to 100 thousand), Dact becomes more and more unresponsive, up to unusable.

If finally all hits are found, and you click on a single file, for instance in the Keyword in context mode, it takes 15 seconds to highlight that line.

Double-clicking on a line (in order to see the tree of that line) takes very long as well.

Going back to the sentences-tab then takes a minute.

@danieldk
Copy link
Member

danieldk commented Oct 9, 2013

The primary cause of slowdowns is the fact that Qt needs to get size hints for every entry and since we are using proportional fonts, it needs to go through the font renderer. This can be observed by switching off 'Show Filenames' and using 'Complete Sentence' in the sentences tab. Dact will be more responsive, since we use a fixed width for the last column.

Summarized: Qt wasn't really made for such large list views with multiple columns.

There are three workarounds (I think):

  1. Use lazy loading. But it gives quite a subpar experience (I used this in the mining viewer) and when you have scrolled through a substantial number of items, the same problems will surface.
  2. Use resevoir sampling to maintain a sample of N sentences. This would work for very large corpora as well, but may upset users, since items can disappear as more results are found.
  3. Introduce pagination.

@gertjanvannoord
Copy link
Member Author

pagination might be the simplest? Users are used to such a presentation of many results.

would not be bad to do this for the Tree widget too - might make that widget a bit more reactive as well.

@danieldk
Copy link
Member

On Oct 10, 2013, at 8:52 AM, gertjanvannoord wrote:
pagination might be the simplest? Users are used to such a presentation of many results.

would not be bad to do this for the Tree widget too - might make that widget a bit more reactive as well.

I think that I would like to try both pagination and sampling. I dislike pagination, but I don't know how annoying sampling will be ;).

danieldk added a commit that referenced this issue Oct 11, 2013
In FilterModel, a lot of locking is used to ensure the result list is
always observed in a valid state. However, the list is locked very often
for updates, blocking all reads that update the user interface.

So, instead, we maintain two lists: one that that backs the actual model and
one that is rapidly updated through query iteration. The list backing the
model uses a QReadWriteLock, to avoid that multiple reads are blocking
eachother. A write to that list only occurs in fireDateChanged(), to replace
the model-backing list by the updated list.

When profiling, this removes the lock overhead. This is a part of the
solution to #123. We are not there yet, since the interface is still slow
due to all the field width calculations that Qt needs to perform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants