-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Refactor Profanity and Reserved names functionality #18556
Labels
Comments
Agree 100% |
I DON'T KNOW WHY, SUNWELLCORE IS BETTER THAN THE CURRENT CORE PERFORMANCE |
Because it was a little more than a collection of hacks with barely anything working as it should? |
Kitzunu
added a commit
to Kitzunu/azerothcore-wotlk
that referenced
this issue
Jul 2, 2024
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe your feature request or suggestion in detail
At the moment these two functions are heavily unoptimized:
azerothcore-wotlk/src/server/game/Globals/ObjectMgr.cpp
Line 212 in 77bbcb3
azerothcore-wotlk/src/server/game/Globals/ObjectMgr.cpp
Line 240 in 77bbcb3
The thing is that we iterating over 25 000 strings, then we are making some replacements in every of them and finally we are making comparison.
We are calling it on every login and character creation, which can be resulted in diff spikes.
During my load testing with 1 000 characters login the diff spike was 22k ms (22 seconds).
When I disabled
StrictNames.Reserved
&StrictNames.Profanity
, the same test - the spike is 2k ms (2 seconds).Describe a possible solution to your feature or suggestion in detail
We should move this logic to the server loading stage. At this stage, we would build a search tree (e.g., std::set) from normalized strings. During "runtime", we can simply search for the word in this tree (which would take O(log n) time instead O(n)+string normalization on every iteration).
Additional context
No response
The text was updated successfully, but these errors were encountered: