Skip to content

add unmanaged-kcp transport#3865

Closed
Molth wants to merge 1 commit intoMirrorNetworking:masterfrom
Molth:master
Closed

add unmanaged-kcp transport#3865
Molth wants to merge 1 commit intoMirrorNetworking:masterfrom
Molth:master

Conversation

@Molth
Copy link
Copy Markdown

@Molth Molth commented Jul 20, 2024

No description provided.

@SoftwareGuy
Copy link
Copy Markdown
Contributor

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

@miwarnec
Copy link
Copy Markdown
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
Copy Markdown
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