Skip to content

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#2092
KaelaSavia wants to merge 5 commits intoalliedmodders:masterfrom
KaelaSavia:master

Conversation

@KaelaSavia
Copy link
Contributor

Resolves #1935

Original solution found by #1935 (comment)

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)
@dvander
Copy link
Member

dvander commented Dec 6, 2023 via email

@KaelaSavia
Copy link
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!

@Headline
Copy link
Member

Headline commented Dec 7, 2023

Gotcha.

As for making code platform dependent, I believe it would complicate things unnecessarily and would serve no functional benefit in this case!

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

@KaelaSavia KaelaSavia closed this by deleting the head repository Dec 7, 2023
std::vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.size(); ++listentry)
{
std::vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be a zap function or something to just clear the vector.

entry--;
}

if (pawnhooks.size() == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed.

if (pawnhooks.size() == 0)
{
delete vtablehooklist[listentry];
vtablehooklist.erase(vtablehooklist.begin() + listentry);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto on zap / clear, can happen at the end outside of the loop.

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.

Bulk SDKHooks perform significantly worse on Linux than Windows

4 participants