IntelliPrompt completion session performance issue with lots of items

SyntaxEditor for WPF Forum

The latest build of this product (v25.1.0) was released 2 months ago, which was before this thread was created.
Posted 16 days ago by Stefano
Version: 25.1.0
Avatar

Hello,
We are experiencing performance issues with some of our users' applications. 
When they edit the code, there are slowdowns.
After investigating, it seems to be caused by the filtering of items in an IntelliPrompt completion session.
We have a completion session with a high number of symbols (>2000), and the following options are enabled:

CompletionSession session = new()
{
    CanCommitWithoutPopup = canCommitWithoutPopup,
    CanFilterUnmatchedItems = true,
    MatchOptions =
        CompletionMatchOptions.IsCaseInsensitive |
        CompletionMatchOptions.TargetsDisplayText |
        CompletionMatchOptions.UseAcronyms |
        CompletionMatchOptions.UseShorthand
};


This is reproducible with the above configuration, with example 10 from the syntax editor sample browser, inserting over 2000 completion items in SimpleCompletionProvider.cs.
If you open the completion session and edit (for example, by holding down a key on the keyboard), you can see that text entry is slowed down when filtering completion items; however, when there are no more items to filter, the slowdown disappears.
https://ibb.co/6cjxHmXF

Here is the code of SimpleCompletionProvider.cs I've used to reproduce it:
https://pastebin.com/Y4j10f5a

Is it due to the filter? If so, is it possible to not block the UI thread while the filter is being applied?

Comments (4)

Posted 16 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Activating shorthand matching with UseShorthand will be the most flexible but if you have an enormous list, it will affect performance the more you type due to it having to use regex matching with many ".*" in it.  Acronym matching can also affect performance but not as much.  You will need to try disabling one or both to see if that helps.  You can write your own custom item matchers as well.

In the future we would like to make completion lists more async but that will require a major rewrite of how they work.  I will log your request with that TODO item.


Actipro Software Support

Posted 11 days ago by Stefano
Avatar

Hello, thank you for the response.

We have a few questions:

We've reviewed the documentation regarding custom item matchers. From what we understand, both implementing ICompletionItemMatcher and extending RegexCompletionItemMatcherBase would still execute on the UI thread, so they wouldn't solve the responsiveness issue unless the performance cost of the regex is trivial, correct?

You mentioned that UseShorthand relies on regex matching. Are the regex patterns used for matching precompiled? If not, do you think precompilation would help improve performance in our scenario?

Unfortunately, disabling UseShorthand isn't an option for us, as many of our users rely on that behavior.
Are there any other workarounds you would recommend?

Finally, and most importantly, is there any estimated timeline for when async support for completion filtering might be available?

Thanks again for your support

Posted 11 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

You can implement ICompletionItemMatcher however you wish.  It doesn't necessarily need to use regular expressions.  RegexCompletionItemMatcherBase and its derived classes do use regular expressions.  And my mistake on the current shorthand implementation... it used to use regular expressions with a lot of ".*" in it and that had significant performance issues with very large lists, but we changed to a faster non-regular expression algorithm in 2022 that dramatically improved performance.  We have a test here with 10,000 items that have randomized text, and shorthand typing performance is very good on that in the current version.  Which version are you on?

If you are on a post-2022 version and want to put together a new simple sample project that shows the performance issues you're seeing, please send it to our support address and reference this thread in your email.  Be sure to exclude the bin/obj folders of the .zip you send so it doesn't get spam blocked.  Then we can debug with that and see if there are further updates we can make.

As for timelines, we are just starting work on major updates to SyntaxEditor.  Async completion is one of the items on the list of things we'd like to tackle as part of the updates for v26.1, but it's realistically going to be a number of months before we get there.


Actipro Software Support

Posted 10 days ago by Stefano
Avatar

Thanks for the clarification.

We're currently using version 25.1 and have been able to reproduce the issue using the sample browser, specifically by modifying example 10 with a large set of items. We'll prepare a minimal sample project that demonstrates the slowdown and send it to your support address shortly, referencing this thread as suggested.

Add Comment

Please log in to a validated account to post comments.