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
Faster World Gen on WSL?? #4784
Comments
Yea, WSL2 is linux, and Linux is faster than windows. This shouldn't really be an issue on github though. |
Linux itself isn't inherently faster than Windows and WSL2 is just a Hyper-V VM so there's going to be a little overhead regardless. But, I'm here to mainly ask the question of why is it faster on WSL2, which could purportedly be an issue if somebody wanted to host on a Windows machine when it would be objectively better to run Cuberite on WSL2. |
I suspect the difference is down to the compiler. MSVC has at least historically been far behind gcc and clang in terms of optimising code. It's possible we could improve things a bit with some compiler flags. Did you build the executables yourself or download from cuberite.org? If you built it yourself then |
Hmm I know MSVC has the /favor flag but I'll look more into optimizing on the Windows side. I'll try again tomorrow using 'optimized' flags to see if anything can be improved upon |
I don't think measuring Cuberite directly is a good idea, there's a lot of other stuff going on under the hood. Perhaps if you could somehow extract the world gen itself (or at least a part of it) and measure its performance, it would be a piece of information of much more value. |
Might also be worth experimenting with mingw, see if it is closer to the WSL or nativeWin perf. |
What do you think would be a good way of testing would be? Right now I'm just setting the PregerateDistance to 128 in the world.ini, then deleting the world data and then just starting up the server which in my opinion would show a general view of how well Cuberite is generating chunks since it seems like no other process can be running until the initial world is generated. Also I was playing around with MSVC some more and got it to do 300-500ch/sec with bursts to 900+ch/sec on my i5 7300HQ laptop. A very big improvement so far (I think a lot of it was just enabling intrinsics). This is generating new chunks:
Flags Used/Changed from Default:
For Comparison, Running WSL2:
Also, @peterbell10 the -march=native flag is already set in the CMake configuration |
I can't find a Quick March flag for Visual C++. I guess we could try throwing the kitchen sink at the CMake files and enable every compiler flags to do with performance. |
Client version: 1.12.2
Server OS: Windows/Linux (WSL2 Ubuntu 20.04)
Cuberite Commit id: 99f8c44 (for both)
Processor: i7-4770
Expected behavior
The same, or worse, performance on WSL compared to running natively on Windows
Actual behavior
WSL gets around 1.5-2x the speed of Windows somehow? I'm really just curious as to how/why
Steps to reproduce the behavior
Compile on Windows then compare to WSL
Server log
WSL (Pregenerated):
WSL (Generating Chunks):
Windows (Pregenerated):
Windows (Generating Chunks):
The text was updated successfully, but these errors were encountered: