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

perf: optimized moveCreature and spectators #2667

Merged
merged 2 commits into from
Jun 15, 2024
Merged

Conversation

mehah
Copy link
Contributor

@mehah mehah commented May 29, 2024

  • In moveCreature, a check was added so that the spectator's search is not called twice, now only one position is passed with the interval adjusted to assume both positions as if it were.

  • In spectators we no longer use vector_set but just vector and if there is a need to remove record duplication, it will use unordered_set passing the vector in the constructor which is much faster.

  • Why was useCacheMap disabled?
    As the map cache is done synchronously for each movement that a monster makes, it is better to disable it,
    as the pathfinder, which is one of the resources that uses this cache the most,
    is multithreding and thus the processing cost is divided between the threads.

@dudantas dudantas merged commit 883c3ff into main Jun 15, 2024
33 checks passed
@dudantas dudantas deleted the walk_spec_optimization branch June 15, 2024 00:26
dudantas pushed a commit that referenced this pull request Nov 10, 2024
As per this PR: #2667

useCacheMap has been disabled, but the code is still there just for
decoration, so this PR will remove all that code.
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.

3 participants