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

Performance problem with AutoCompleteBox on the initial drop-down #67

Open
PhilJollans opened this issue Jan 8, 2023 · 0 comments
Open

Comments

@PhilJollans
Copy link

I have a weird performance problem with the AutoCompleteBox.

To illustrate the problem, I have generated a list with the 1000 strings A0 to A999.
When I enter the character A, the list opens with 1000 items.

The first time the list opens, it takes an unacceptably long time, of 5 seconds or more.
After that it opens much more quickly.

I have observed:

  1. The delay is dependent on the number of items in the drop down list. If there are 100 items there is no significant delay.
  2. The delay happens once only in my application.
    If I have two AutoCompleteBoxes, the delay occurs on opening the first one of them, but not the second one.
    This remains true if the first one has only 100 items, but the second one has 1000 items.

This combination is strange, because it appears to be a one-off action (like loading a DLL), but the duration is dependent on the the number of items (not at all like loading a DLL).

In my application I am actually populating the list dynamically from a database (in the Populating event).
My current strategy is to limit the number of items to 100 for the initial load, but then to limit it to 1000 for subsequent loads. That kind of works, but I'm not really happy with it.

I have no idea if this effect is due to a problem in the AutoCompleteBox, or a more general problem in WPF.
At present, I am quite baffled and don't have a good idea about how to debug the issue.

By the way, I have two test programs in my own fork of the repository:
https://github.com/PhilJollans/WpfToolkit/tree/master/WpfToolkit/AutoCompleteTest2
is a very basic example with three AutoCompleteBoxes.

https://github.com/PhilJollans/WpfToolkit/tree/master/WpfToolkit/AutoCompleteTest
is approximately the strategy that I am using in my application.

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

1 participant