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 performance of the map view after reading a map #70574

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

db48x
Copy link
Contributor

@db48x db48x commented Jan 1, 2024

Summary

Performance "fix performance of map view after reading a map"

Purpose of change

When you read a map, we now keep track of what overmap tiles the map revealed to you, so that we can blink them in the map view. Unfortunately the initial implementation of this feature turned out to be rather slow.

Describe the solution

I’ve changed it from a vector of coordinates to an unordered_set, so that membership testing is O(1), greatly improving performance.

fixes #70540

When you read a map, we now keep track of what overmap tiles the map
revealed to you, so that we can blink them in the map view. I’ve
changed it from a vector of coordinates to an unordered_set, so that
membership testing is O(1), greatly improving performance.

fixes CleverRaven#70540
@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) Code: Performance Performance boosting code (CPU, memory, etc.) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 1, 2024
@akrieger akrieger merged commit 8297d71 into CleverRaven:master Jan 1, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading a map tanks overmap view performance
2 participants