Band-aid for Bulk SDKHooks performance impact#2092
Closed
KaelaSavia wants to merge 5 commits intoalliedmodders:masterfrom
KaelaSavia:master
Closed
Band-aid for Bulk SDKHooks performance impact#2092KaelaSavia wants to merge 5 commits intoalliedmodders:masterfrom KaelaSavia:master
KaelaSavia wants to merge 5 commits intoalliedmodders:masterfrom
KaelaSavia:master
Conversation
Resolves partially: #1935 There shouldn't be any issues. Potential adjustments could include storing hook information and unhooking on map end although it's not necessary. Original work by #1935 (comment)
Member
|
Just remove the code or make it platform dependent.(Not commenting on the validity of the change but commented code is a style/readability problem)
|
Contributor
Author
|
Gotcha. As for making code platform dependent, I believe it would complicate things unnecessarily and would serve no functional benefit in this case! |
Member
If the issue is limited to one platform, and this is a "bandaid" fix, scope could probably be limited. KyleS mentioned us resetting the table on levelend, seems that's missing here |
| std::vector<CVTableList *> &vtablehooklist = g_HookList[type]; | ||
| for (size_t listentry = 0; listentry < vtablehooklist.size(); ++listentry) | ||
| { | ||
| std::vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks; |
Member
There was a problem hiding this comment.
there should be a zap function or something to just clear the vector.
| entry--; | ||
| } | ||
|
|
||
| if (pawnhooks.size() == 0) |
| if (pawnhooks.size() == 0) | ||
| { | ||
| delete vtablehooklist[listentry]; | ||
| vtablehooklist.erase(vtablehooklist.begin() + listentry); |
Member
There was a problem hiding this comment.
ditto on zap / clear, can happen at the end outside of the loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1935
Original solution found by #1935 (comment)