-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add thread support to CreateDialog
#88984
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
So it shows some issues right now with 1000 classes, I'll investigate why the threading doesn't help. |
// Configure search items. | ||
callable_mp(dialog, &CreateDialog::_create_search_option_items).bind(candidates, search_text).call_deferred(); | ||
|
||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sort of busy loop is detrimental to performance. I'd suggest you to use a semaphore or a condition variable instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trend is to have as many threaded tasks as possible in the WorkerThreadPool
. I'd suggest using it instead of spawning bespoke threads. Besides the reason of having all the threaded work flowing through a single component that may do more clever scheduling in the future, bear in mind that creating a thread is not guaranteed to happen quickly. It's indeed somewhat slow on Windows.
Closing. I'll investigate more the issue. |
One note here: I did some small but still somewhat noticable improvements for the |
Adds thread support to
CreateDialog
. This removes will remove any engine-wide lag when searching in theCreateDialog
.Capture.video.du.2024-02-28.15-47-45.webm
(it has some glitches, see the note below about "Draft")
Notes
THREADS_ENABLED
, so it should work as well on builds without threads support.Draft
Fixes