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

add unmanaged-kcp transport #3865

Closed
wants to merge 1 commit into from
Closed

add unmanaged-kcp transport #3865

wants to merge 1 commit into from

Conversation

Molth
Copy link

@Molth Molth commented Jul 20, 2024

No description provided.

@SoftwareGuy
Copy link
Contributor

Got any performance benchmarks to back up these claims? That'll boost possibility of getting it merged into Mirror mainline.

@miwarnec
Copy link
Collaborator

@Molth is this still worth it over threaded C# kcp? and have you compared this against IL2CPP compiled kcp?
perf. should be similar with IL2CPP.

there are a few reasons why we chose pure C# for kcp:

  • able to inspect and debug all the code easily
  • we fixed a few bugs in kcp that skywind never addressed
  • C# version runs on all platforms. native we'll have to compile on windows/mac/linux/mobile/consoles/etc.

@James-Frowen
Copy link
Contributor

after a quick look, I would guess the increase in performance is from using memcpy instead of MemoryStream. I would assume there could be similar gain using byte[] and Buffer.BlockCopy

the unsafe/unmanaged code itself shouldn't give any major performance increase over managed c#, because all that will do is skip safety bounds checks on arrays.

@Molth Molth closed this Jul 25, 2024
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.

4 participants