BenchmarkNet (Stress test for ENet, UNet, LiteNetLib, Lidgren, MiniUDP, Hazel, Photon and others)

Did somebody was able to run benchmark or part of clients in such environments?

  1. Android + .NET Standard 2.0 + Mono
  2. Android + .NET Standard 2.0 + IL2CPP
  3. iOS + .NET Standard 2.0 + IL2CPP

To be sure System.Net.Socket + IL2CPP + .NET Standard 2.0 implementation of Unity works well on mobile devices.

@dzmitry-lahoda I can perform such tests for you on LG Nexus 5, if you want.

And thank you for the contribution, I’ve sent you an email.

Hey, that sounds very intresting, I tried doing this myself once on my game data I send to clients, but found out it was actually adding more bytes than removing (from the header i suppose) I even tried experimenting with the dictionary function for LZ4, by logging data im sending to clients, then training the LZ algoritm on that to create a dictonary, it diden’t give any benefits either.

Maybe I’m already at maximum compression, and cleverness with data, since i’m working on bit level on every piece of data and so on, but anyway, perhaps allowing enet lz4 implementation work with supplied dictionary might be a great idea, what do you think?

It depends on compression level, but in general, this happens when the buffer doesn’t contain enough repetitive data, and the algorithm is not able to do anything with it. The plain text for example.

Hard to say actually, trial and error until we found what works best for our data, this is how we are doing it. :slight_smile:

I’ve tried several solutions, and in terms of speed and compression ratio, LZ4 works best in my tests. The closest competitor is Density.

@nxrighthere , my end goal to find if there is any of open source library which works well during intermittent worsening of network conditions (packets larger than MTU during abrupt world change while playing during bus ride) in constrained device (iOS or Anrdoid IL2CPP) with .NET Standard 2.0 Unity target (forward looking compilation target). And that knowledge somehow shared with community (right now, I guess, somebody knowы what open source libraries work well in that setting, but I did not found yet).

If you or anybody else will test that and share(at least part of setup - like Android IL2CPP .NET Standard 2.0 with tests from BenchmarkNet with no network issue) - would be very cool. Right now I am trying to finger point best open source by reading issues and test only one against Photon. That may not work.

I bothered because specific build target end environment may not work for networking code, like Allow default binary protocol run in AOT environment with no code generation (.NET Standard 2.0 with no Emit) Ā· Issue #3122 Ā· aspnet/SignalR Ā· GitHub

This is where the concept has already failed. Read this thread, you can find there useful stuff, regarding this. And here’s some advice from the creator of ENet.

LiteNetLib support .NET Standard 2.0 if I remember correctly, so you can try it.

@nxrighthere any news yet? :slight_smile:

Trying to fix two bugs that I found a few days ago, and then pushing the code to the repository. Documentation and API reference is not finished yet as well, so it will take time.

3 Likes

Is the repository supposed to be completely empty except for the readme and the license?

@Prodigga If you are talking about a repository that related to the ScionNet, then yes, I didn’t upload the source code yet. I’m trying to fix a bug which reveals when a high parallelism degree used to consume batches of network messages in multiple threads.

4 Likes

You can do this when your data is optimized even on generic 4-core CPU.

5 Likes

500 players. Just amazing.
Quick question. What’s the degree of parallelism on the demo been used?

First option. In this demo, synchronization functions/state updates called per entity, and every frame batches of network messages consumed and processed in the main thread.

3895939--331489--updatestate.PNG

1 Like

Much appreciate that.
I’m shocked that single producer and single consumer give results like that.

You can run a thread on a certain core using ProcessorAffinity. But I don’t recommend to do that for many reasons.

So just creating a Thread would be enough?

  networkThread = new Thread(UpdateNetworkThread)
            {
                Name = "Network thread"
            };

            networkThread.Start();

Yes, and just follow this general recipe.

1 Like

Thank you so much.

Hi @nxrighthere first of all you did a such amazing job on ScionNet. I’m just curious you wrote this on scionnet github repository

can you please explain why scionnet is limited to these platforms ? if i remember correctly scionnet use a modified version of Enet which is compatible with Android and IOS

I don’t know anything about ARM processors/operating systems, this is not my area, and I’m not interested/motivated to work in this direction. Also, I don’t have appropriate devices/resources. However, everything should work in constrained environments, but how well it will work there is a question.