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

Improve search performance (caching, cancellation, parallel search) #460

Closed
wants to merge 2 commits into from

Conversation

drognanar
Copy link
Contributor

Improves search performance. Returns results without any observable delay when searching through large docsets (including .NET and QT).

Cancels previous incomplete searches.
Defers browser url loading.
Adds caching of previous searches. Filters through the existing result list to avoid searching through the entire docset.
Adds parallel searching of docsets.

Depends on #459 in order to correctly display ToC after ESC is pressed.

@trollixx
Copy link
Member

This is an awesome work. Thank you!

I'll be going over and cherry-picking commits individually shortly. I wish GitHub could create series of PRs like Gerrit does.

@@ -412,6 +472,7 @@ void Docset::countSymbols()
const QString symbolType = parseSymbolType(symbolTypeStr);
m_symbolStrings.insertMulti(symbolType, symbolTypeStr);
m_symbolCounts[symbolType] += query.value(1).toInt();
m_symbolsTotal += query.value(1).toInt();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this being used anywhere...

@drognanar drognanar force-pushed the perf branch 2 times, most recently from 492234b to 4bf9f36 Compare March 16, 2016 08:07
@drognanar
Copy link
Contributor Author

Made changes to the PR. I rolled back changes I made with regards to pointers.

****************************************************************************/

#include "cachingsearchstrategy.h"
#include "docset.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort alphabetically, adding an empty line after cachingsearchstrategy.h.

@drognanar drognanar force-pushed the perf branch 2 times, most recently from 8f288b8 to f587761 Compare April 14, 2016 06:36
@drognanar
Copy link
Contributor Author

Another update

@mrhota
Copy link

mrhota commented Jun 19, 2016

@drognanar Any updates here? I can rebase this if you don't have the time.

@mrhota
Copy link

mrhota commented Jul 4, 2016

@trollixx @drognanar what needs to happen to move this along? Fuzzy searching is waiting on this.

trollixx added a commit that referenced this pull request Jul 19, 2016
Based on work by Artur Spychaj submitted in #460.
Related #265, #523.
Closes #564.
trollixx pushed a commit that referenced this pull request Jul 20, 2016
When user types into the search box the previous search is canceled.
This improves the speed with which the results can be obtained.

Based on #460 plus cosmetic changes.
Related to #265, #523.
trollixx added a commit that referenced this pull request Jul 20, 2016
Add query cancellation at a docset level.
This allows the query to be cancelled midway a large docset run.
Add caching to docset results.
This should limit the number of items to search through for longer
queries.
@trollixx
Copy link
Member

I've been going over this multiple times, and the implementation details seem very counterintuitive to me. Exposing docset internals outside of Docset class is one of such things. It's quite opposite from what I was trying to achieve by encapsulating everything in one class.

I am really not comfortable with merging it right away, as I am not completely sold on search strategies idea. Chaining multiple is not a really flexible approach. For example, it leads to iterating over results directly, while there's no way to apply custom search logic. Also the order in which strategies can be chained is also fixed, what I'd consider a design flaw.

There are a decent amount of unrelated changes here, like replacing QScopedPointer with std::unique_ptr, removing Docset::path(), etc.

I'd prefer to hold this off a bit longer, and see how's other changes from this PR will do in the next release.

@trollixx
Copy link
Member

This is a very old and abandoned PR, let's put it to rest.

@trollixx trollixx closed this Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants