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

Map preview lagging/ crashing for some users #626

Open
GrantBartlett opened this issue Jan 6, 2025 · 1 comment · Fixed by #627 · May be fixed by #630
Open

Map preview lagging/ crashing for some users #626

GrantBartlett opened this issue Jan 6, 2025 · 1 comment · Fixed by #627 · May be fixed by #630

Comments

@GrantBartlett
Copy link
Member

GrantBartlett commented Jan 6, 2025

Need a crash log most likely and someone to double check the GameInformationPanel changes.

@SadPencil
Copy link
Member

SadPencil commented Jan 6, 2025

I'll reopen this issue. For unofficial maps, currently the client extracts the preview image from a Lzo compression, which consumes much CPU time.

Quick fix: disabling map previews for unofficial maps

Real fix: maintain a cache (an IReadOnlyDirectory<string, byte[]>, readonly for the invokers but writable for the background thread) for non-official maps. If the cache misses, don't display the map preview for this time. Meanwhile, insert the map into a queue (ConcurrentQueue). A background thread (it runs forever, with loops and sleeps to check whether the queue has incoming requests) extracts the image bytes from lzo bytes and add the image to cache. Next time, the map preview should be available. Note: the overhead comes from lzo. No need to keep the texture loaded to reduce the use of VRAM.

@SadPencil SadPencil reopened this Jan 6, 2025
@SadPencil SadPencil linked a pull request Jan 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants