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

Fix Loading State #15386

Merged
merged 2 commits into from
Sep 15, 2024
Merged

Conversation

lemz1
Copy link

@lemz1 lemz1 commented Aug 22, 2024

The mutex in the loading state was used in a wrong way. It was acquired at the beggining of the thread and only released at the end of the thread, which basically just blocked all other threads from working.

So this pr uses the mutex only when necessary, meaning only when needing to update shared variables.

I did do a small test to see if performance is better, and it seems to be better.
CPU: i7 870 (8 logical processors)
Before the fix loading Bopeebo took 1.8 seconds
After the fix loading Bopeebo took 0.2 seconds
I only tested it once, so take the benchmark with a grain of salt.

Copy link
Contributor

@crowplexus crowplexus left a comment

Choose a reason for hiding this comment

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

thank you

@ShadowMario ShadowMario merged commit 256f915 into ShadowMario:experimental Sep 15, 2024
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

Successfully merging this pull request may close these issues.

5 participants