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

Network perf improvements #4205

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Conversation

Mag-nus
Copy link
Member

@Mag-nus Mag-nus commented Jul 22, 2024

This utilizes stackalloc in the networking code, where applicable, to avoid excessive allocations of new byte[]

Co-authored-by: @FlaggAC

{
Pack(buffer, ref offset);
}

public void Pack(byte[] buffer, ref int offset)
public void Pack(Span<byte> buffer, ref int offset)
Copy link
Contributor

@FlaggAC FlaggAC Jul 22, 2024

Choose a reason for hiding this comment

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

I would double check to make sure the ref int offset doesn't reference the value on the heap (it's probably fine)

@Mag-nus Mag-nus merged commit e2e88b7 into ACEmulator:master Jul 23, 2024
2 checks passed
@Mag-nus Mag-nus deleted the NetworkPerfImprovements branch July 23, 2024 11:14
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