Skip to content

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

}

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
@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