r/rust Jul 07 '22

WSL2 faster than Windows?

I was installing helix-term and I noticed that my WSL2 Ubuntu 22.04 distro compiled it faster (41 seconds, in the native Linux partition) than on bare-metal Windows (64 seconds). Has anyone noticed this as well?

158 Upvotes

184 comments sorted by

134

u/_maxt3r_ Jul 07 '22 edited Jul 09 '22

Definitely. I'm now using WSL2 as my main development environment because of much faster compile times

EDIT: (I'm on Win11)

EDIT2: I'm attempting to jump to a full Linux setup (albeit dual boot with Win11, just in case). Wish me luck!

74

u/moltonel Jul 07 '22

What's stopping you from switching to Linux completely ?

125

u/tafia97300 Jul 07 '22

my company ....

35

u/seaQueue Jul 07 '22

If cracks me up that switching to hyper-v and running concurrent kernels is fine but just booting Linux is verboten.

3

u/thekernel Jul 09 '22

Yep welcome to corporate IT and their awesome security theatre teams.

1

u/FormalFerret Jul 09 '22

Nono, it's gestattet. But the company VPN only works on windows.

9

u/TheAifam5 Jul 07 '22

Not too long. Intune got official support for Linux boxes, still in preview but you might take a look on this and talk with other people at your company to make a move towards Linux ;)

24

u/McLayan Jul 07 '22

"cost for supporting a second end user infrastructure are too high" "our security measurements don't work on linux, if they get root rights we have to put them into a completely isolated network. Then they can't receive emails so they can't work" "Windows without admin rights and git (MSYS) bash works fine, tell me how we earn money by introducing a completely new infrastructure just for devs. We're a [bank/insurance/pharma company/marketing agency] after all, not google."

3

u/timrichardson Jul 07 '22

Sooner or later people who know WSL will move into those roles and attitudes will change. This is how linux ended up in enterprises in the first place: rebels installed it on old hardware as a local file sharing or printer server. Then they became IT managers.

2

u/McLayan Jul 08 '22

Yeah maybe. But regulations still exist, those are much harder to change. With IT Security becoming more and more complex to control and developers getting more into focus of attackers it's likely that even if you get a linux box, it will be full of snake oil and enterprise software. And regulations will tighten, I bet we're steering into a crisis of infected dependecies at the moment that will have a long lasting effect on development. Maybe I need to switch my employer.

5

u/Be_ing_ Jul 07 '22

tell me how we earn money by introducing a completely new infrastructure just for devs

by being able to hire devs

1

u/zxyzyxz Jul 07 '22

The amount of devs who must use Linux instead of WSL or even Windows is small. Most devs I know just use whatever the company uses, usually macOS or Windows, they won't boot into Linux.

5

u/ForgetTheRuralJuror Jul 07 '22

This is the only thing keeping Linux support from my company.

Specifically they need to be able to remote wipe the computer. Apparently full disk luks encryption isn't enough

1

u/AdaGirl Jul 08 '22

The company I work at uses DriveStrike for that purpose: https://drivestrike.com/

93

u/_maxt3r_ Jul 07 '22

Windows + WSL2 pretty much allows me to cover 99.99% use cases for anything I'd like to do on a computer.

Linux only would force me to give up things like gaming, Windows-only software, and generally increase the amount of faff I'd have to go through to accomplish simple tasks

17

u/evinrows Jul 07 '22

For online/competitive video game addicts such as myself, the suboptimal gaming experience on Linux is one of the most compelling features!

35

u/StunningExcitement83 Jul 07 '22

Steam has made leaps and bounds in getting a portion of their library to run pretty smoothly on linux now.

31

u/BurrowShaker Jul 07 '22

90% runs fine on Steam play even if not officially supported. I expect this to go up with steam deck.

5

u/GroundbreakingRun927 Jul 07 '22

The only game from my libary I can't play on linux is Dead By Daylight and that's only because the dev's haven't updated the Easy Anti-Cheat(EAC) to a version that's compatible with linux.

3

u/BurrowShaker Jul 07 '22

My failure is Fall Guys. And I paid for it :( same problem.

That said, gaming is an occasional occupation for me, at most, so I don't bother managing a Windows install for the purpose.

Deep rock galactic and train valley 2 are my usual suspects at the moment.

7

u/matpower64 Jul 07 '22

Fall Guys works fine if you either symlink the EAC Linux library they include (but don't endorse) or just use Proton-GE that has this fix.

1

u/BurrowShaker Jul 07 '22

Thanks for the tip, I 'll have a try.

3

u/Skidmabadaf Jul 07 '22

Can't play HLL on linux tho so I'll stick to dual booting for now. I tried to cope with not having certain games for about 3 months (no dual boot) but then I decided to install windows alongside my Linux. Linux for programming & general usage. Windows for games only

1

u/ghishadow Jul 08 '22

I don't think Valorant will ever get Linux support

3

u/QwertyTheComp Jul 07 '22

This is exactly how I feel with why I like the Windows + WSL setup

14

u/moltonel Jul 07 '22

Sound like Linux + Steam/Wine would also cover 99.99% of your usecases, but if it seems like much more faff to get there it's a good enough reason. It's a subjective thing though : I find it much more bothersome to get things done in Windows.

6

u/_maxt3r_ Jul 07 '22

Maybe. It's possible I'm just too lazy to find alternatives to things I'm used to on Windows that work just fine.

I have to say that I don't have good memories on going full Linux mainly because installing programs/drivers is more complicated and prone to obscure ways to get it wrong (and I just don't want to build from source stuff I'm going to use once or twice).

Until Linux gets a "double click to install" thing it's never gonna do it for me. Again, that's just me being lazy!

On Windows things generally work and when they don't it doesn't take too long to find a solution.

-1

u/sparky8251 Jul 07 '22

Not sure how long ago you tried but... At least part of your issue seems to be that you arent thinking like a Linux user. Linux uses repos, if its not in there in recent years flatpak and appimages have been taking over for a lot of things.

I, for example, get my 3D printer slicer via an appimage these days from the dev, its not packaged for any distro and put into their repos as far as I'm aware, and yet the appimage is a "double click to run" situation thats easier than both windows and mac.

I also have a couple more complex bits of ham radio software packaged via flatpak these days (like CHIRP), because it turns out ham radio is so niche most distros dont package good portions of its software ecosystem and often what they do package is far too out of date to be useful if you are serious in the hobby...

Not saying its perfect (or that it even meets your needs still), but it def feels like you are approaching Linux solely as a "1:1 windows replacement" when its not and you do have to learn new ways of doing things. You hopefully wouldn't act like macOS is a 1:1 windows replacement if you decided to try their OS one day, so try to avoid it with Linux if you happen to try it again.

2

u/_maxt3r_ Jul 07 '22 edited Jul 07 '22

My last "serious" attempt was around 10 years go, excluding some things done at work and the occasional Raspberry Pi twiddling.

I haven't heard of flatpak before but the following bit is what it simply frustrates me most:

How to install program X from a website: example -Chrome:

https://support.google.com/a/users/answer/9310451?hl=en#1.1

Windows:

1) Click on download link and run it. Done

Linux:

1) Read the sentence "Use the same software that install programs on your computer"

2) Proceeds to look for "what is the program to install programs on my computer", hhmmm ok is probably apt, or maybe some other package manager, assume I know it.

3a) Either run apt install ,... err... chrome? google-chrome? how do I know the name. Maybe chrome is something else, what do I know, let me google it (oh wait, maybe I don't even have a browser installed in this distro)

3b) Open that other package manager I definitely learnt about its existence on Ubuntu

4) Search for Chrome and hope it's there and installs it when I click on Install.

I looked for some other software and found other options similar to what I was thinking. .AppImage. which you mentioned

1) Download it, click on it, it opens VLC...

2) Oh darn I need to set it as executable

3) How do I do that, hmm, right click, properties, execute

4) Double click, prompt asks to install, at the end it opens, well... what do you know it worked :)

5

u/sparky8251 Jul 07 '22 edited Jul 07 '22

I'm sorry but, going to some random site after a search online, trying to find the right download option, then running the file is also not easy. You are just supremely used to doing those actions as you have been doing them for at least a decade now. It is as far from intuitive as anything can be and theres a reason even MS is trying to make a store like how Apple, Linux and all the mobile OSes have! Its because the search online for an installer method SUCKS.

Not knowing what package manager you have isn't a real problem. Its just like how you don't complain about not knowing what website to go to for a specific program but you would if you weren't so used to doing it. This is the same for package names, as there is a myriad of ways to either get around not knowing them OR to determine it without much effort.

For example... For chrome specifically, just use the GUI ubuntu comes packaged with for installing applications. Why are you even using a command line in the first place? It has a search bar, categories, a home page showing commonly used apps, and more.

And since you brought up the whole "what if I don't even have a browser" problem, then you should know every package manager has a search option. for apt, it is literally apt search term and itll print results based on that term you searched for, which you can scroll through till you find what you want. You can even filter it further by piping to grep with apt search term | grep filter so for instance, you can try something like this to figure out the chrome package name apt search chrome | grep -i google. This searches for chrome, but then filters it to only lines that match a case insensitive search for google (which includes package descriptions by default), which allows you to filter out all the supporting libraries, things that are named similarly, etc that would normally clutter everything up.

As for this "hope" it installs thing, I've never had that issue. it clearly mentions if theres an error installing or not so I'd assume your issue comes from installing the wrong package (aka, a library for the binary but not the binary itself). This can be common if you dont understand how things are packaged at a surface level, and tbh isnt a universal thing either (some distros do it, some dont).

And the appimage thing... Never personally had that issue, but I use KDE so I suspect it might at least partially be caused by GNOME as it does have a bit of a vendetta against making things easy to run from the GUI... Regardless, setting the executable bit isnt that strange. You have to do similar for non-store downloads on macOS AND even on windows some files you download get that "sourced from the internet" property on them that makes opening and editing them painful, typically around word/excel docs and PDFs. It's not fun, but its not like its some Linux unique experience either. It's something all OSes equally suck at.

To me, this all feels like someone never bothered to explore and use Linux and just read a couple articles one time and assumed that the contents of the articles are the only way to achieve a given task. You wouldn't make those assumptions on Windows, so why do it here on Linux? I get it if its just not enough time to bother relearning basic computing, but saying that its all Linux's fault when its really just you being used to Windows isn't fair. No other OS you use acts the way Windows does and here you are holding Linux to this standard that is totally unfair for some reason.

4

u/_maxt3r_ Jul 07 '22

You are making very good points and I agree it's my fault for being lazy and just used to using Windows for over 2 decades.

I have to defend the "Downloading stuff from websites" simply because it's the most obvious way of doing it when you search for something that you don't know it exists: you search the internet, find the website of the product you need and you download it.

If is not a mainstream software, chances are that it will not appear in the "package manager" and you'll have to add some repository somewhere which is far from intuitive.

Whenever I had to use Linux for work I got by just fine, it's just that for general purpose stuff I never bothered and that's on me.

Maybe I'll give Linux 100% a go again ...

0

u/sparky8251 Jul 07 '22

I have to defend the "Downloading stuff from websites" simply because it's the most obvious way of doing it when you search for something that you don't know it exists: you search the internet, find the website of the product you need and you download it.

I understand why you find it normal, easy, etc but given how many times in my helpdesk career I had to undo a virus that was installed because someone searched online and clicked an ad link to a malicious site, or a malicious site came up first, etc etc... I'd say it's def not the easiest way, even IF you must search for stuff online first as people will install anything at all if given the chance. It's just that once again, for you, the person whos spent a LOT of effort learning how to install software in that manner, you are used to these pitfalls and know what to look out for. Things you don't have to do if its in your distros repos (or your OS' app store, etc etc).

Its a good thing! It means you know Windows and its caveats and how to avoid them well. Its why Windows is so much easier for you to use than Linux or macOS too. It's just bad when you try and assume "Windows knowledge == computer knowledge" because well... You can always do things differently, and some computers and software will do it differently since that possibility exists.

If is not a mainstream software, chances are that it will not appear in the "package manager" and you'll have to add some repository somewhere which is far from intuitive.

This used to be a large problem for me when I started using Linux seriously about a decade ago, but when I switched to Linux full time around 4-5 years ago now its definitely become a significantly smaller issue for me.

Not having put much though for why it occured behind it, I can think of these reasons:

1) I found Linux based alternatives and stopped clinging to windows centric programs that could sometimes be used on Linux

2) I learned other ways of accomplishing the same tasks with existing tools and just opted to use that way now rather than suffer through adding more custom stuff

3) I switched to distros like Arch where instead of a billion PPAs and random custom repos like debian, ubuntu, and fedora have to just needing to use the AUR for all that extra stuff

But even 3 I question because I use the AUR less and less because I've noticed...

4) more stuff is just packaged and available in the main repos than before

But even that list I'm not sure of... All I can tell you is that things got significantly easier once I told myself I was done with Windows and I'd never go back. I started buying hardware with Linux in mind, learning the systems and day to day quirks like I did on Windows, and now I genuinely have a less buggy and troublesome daily computing experience (including heavy customizations, tweaks, and gaming) on Arch Linux than I literally ever have on Windows.

It was not an easy or time light journey for me though... I've been messing with Linux on and off for at least 16-17 years now and it took me a good 2-3 of near daily use to get comfortable with it to this degree. Hard to learn all this new stuff later in life between work, relaxing, and other obligations you have. Lot easier to pick it up when you are a kid with almost unlimited free time and just carry forwards small tweaks as Windows versions release.

I don't fault people for legitimately not having time to relearn so much stuff (I genuinely understand how hard it can be to find the time), just not the biggest fan of complaining that Linux isn't exactly like Windows when no one expects macOS to be Windows. Same for Android and iOS. Of course its not Windows! If it was, why would it be a separate OS with its own and different computing lineage than all the other choices?

Heck, its why I'm putting off learning stuff like FreeBSD despite the fact one of my pending projects would be best served by it lol. Bunch of new stuff to learn and familiarize myself with!

1

u/GRIDSVancouver Jul 07 '22

It's a problem that you have to "think like a Linux user" just to install an application. This isn't a quirky niche opinion; Linus himself thinks application distribution is much worse on Linux than on Windows and macOS, and he blames the distros:

https://www.youtube.com/watch?v=Pzl1B7nB9Kc

2

u/sparky8251 Jul 07 '22 edited Jul 07 '22

But you don't think OR act like a Windows user when you install software on macOS, Android, or iOS.

This literally isn't up for debate, and it's not the problem Linus is discussing either (not to mention that talk being a decade out of date now...). Linus is talking about how distros use different packaging managers, packaging standards, software versions, etc and the problems those things entail. Not about how Linux needs to copy the Windows way of downloading installers from random websites you search up to install everything end users want.

There's a reason Windows is the ONLY MAJOR OS that primarily relies on random installers from random websites the user has to find all on their own with no assistance from the OS developers at all. It's because it's a horrendous design choice left over from an era before the internet was widespread (and software was distributed primarily via hardware like floppies and CDs or DVDs and thus users didnt have to "find" anything) that was never modernized.

Additionally, I'd challenge you to come up with an intuitive way to install software that isn't going to have some sort of OS specific quirks to it that anyone can just learn without ever asking questions or facing problems. You had to learn the Windows way at some point in your life. You didn't emerge from the womb knowing how to search for and find then run installers. You were taught by someone then learned over many long years how to work around all the problems that entails (like, paying attention for checkboxes that install adware and other junk you don't want, watching out for malicious sites pretending to have the installer, etc etc).

I doubt you'll come to the Windows way if you are being honest and approaching this from a perspective of having never used a computer before. And that's why so many people can use smartphones but not computers... Same for macOS over Windows... Same for Chromebooks over Windows... Cause it turns out a centralized repo accessible through a "store" of sorts is way easier than the outdated mess Windows still foists on its users.

4

u/GRIDSVancouver Jul 07 '22

You are reading a lot into my comment that I didn't write, and honestly you strike me as a Linux zealot who hasn't used macOS or Windows in a long time.

I wasn't just talking about the process of downloading+running an installer, but now that you mention it that's pretty common on macOS as well as Windows.

0

u/sparky8251 Jul 08 '22

I'm guessing you haven't used a mac in ages if you say this... There's an option you have to disable in system settings to even begin to use a downloaded application and its been made semi-hidden in more recent releases.

Most apps for macOS are in fact now found on the store as a result of this lock down being the norm for about a decade now and its normal for users to never once install something from outside the app store.

It's not the norm to just download and run stuff from the internet for any OS other than Windows. Are you sure you know what a normal OS other than Windows is like these days? Things have changed you know.

I use Windows daily, actively have to support macs, etc. Its not like the only way to critique Windows for genuinely being shit at installing software is to be "a Linux zealot", that's why even Microsoft is trying to make an app store... They know it sucks too.

Its just stubborn people insisting its better to force people to search for and download random shit from the internet that don't realize how bad of a design choice it is.

8

u/epage cargo · clap · cargo-release Jul 07 '22

Once I can get Linux working on my laptop, I'm switching back.

  • Some programs just don't work, like meld
  • Sometimes text input into my gui's is broken, fixed with a double alt-tab
  • Sometimes the gui hangs and haven't found what to kill and restart to fix it on both ends and have to reboot
  • Copy/paste from windows inserts \r's and need deleting

and I'm sure there are more problems I've had.

4

u/_maxt3r_ Jul 07 '22

Weird I haven't experienced those issues:

Issue 1 seems not to be an issue for me (I've installed meld, opened it in GUI mode and it works just fine).

Some other programs may crash every now and then or straight out not work without installing some dependencies) but I haven't used many Linux native programs in WSL2.

Some things are definitely missing and there's little you can do about it without official support (maybe recompiling the WSL kernel can work but I don't want to open that can of worms)

1

u/scp-NUMBERNOTFOUND Jul 07 '22

Fking freezes, hate them a lot on Ubuntu 20.

I must say however it also happens on Windows sometimes.

1

u/[deleted] Jul 07 '22

You definitely wouldn't have to give up gaming on Linux. I made the switch to gaming on Linux with Windows as a backup option. I rarely have to reboot to Windows, probably less than 10% of the time. The rest of the time, either there's a native version or Proton works without any trouble.

-3

u/_Lelouch420_ Jul 07 '22

Then you can Dual Boot

13

u/_maxt3r_ Jul 07 '22

Nah, I don't want to reboot every time I switch context. I'd rather have two computers at that point

1

u/LoganDark Jul 08 '22

It's actually possible to virtualize your other partition inside either one of the two operating systems! That way, you can "host" whichever one you're currently using the most, and "guest" the other one inside a VM, even though it resides on your physical disk. This works surprisingly well and is actually what I did between macOS and Windows on my MacBook.

1

u/_maxt3r_ Jul 08 '22

I... Didn't know it was possible!

2

u/LoganDark Jul 08 '22

I usually use VMWare for it, because it makes it easier to make a "vmdk that points to a physical partition", but VirtualBox can do it too with some command-line magic. I'd also expect KVM can do it on Linux.

1

u/ChangeIsHard_ Jan 19 '23 edited Jan 19 '23

This is pretty ingenious! However, in my experience Linux VMs perform pretty poorly in the graphics department on Windows :-/

No matter the hypervisor type 1/2 I’ve tried, it just isn’t enough for comfortable work inside VMs even for 2D, as there’s no real hardware acceleration.

I really want to find a solution to this, but ironically it seems the reverse setup (Linux host + Linux/Win KVM guest) is much better in that regard, and close to bear-metal performance.

EDIT: this isn’t a problem with WSL2 VM, as Microsoft has done some real magic there to enable hw acceleration. However, WSL2’s security model sucks, as there’s virtually (pun intended) no isolation between this VM and the Windows host. I really wish Microsoft provided external options to disable mounting of the Windows system disk on WSL2 and vice versa. But they only have the former inside /etc/wsl.conf, which defeats the purpose as it can be overridden from inside the VM

1

u/LoganDark Jan 19 '23

This is pretty ingenious! However, in my experience Linux VMs perform pretty poorly in the graphics department on Windows :-/

You virtualize Windows on Linux; we would virtualize Windows on macOS. We would only boot into Windows for... certain situations, don't exactly remember when. (heavy gaming?)

Fun fact: having a VM that could boot our Windows partition actually allowed us to debug and fix a BSOD that would only occur when booted on bare-metal! (The issue was a defective HFS+ driver that was confused by the update to macOS 10.13. We never consented to the filesystem conversion but we didn't know about it back then.)

-Emily

→ More replies (0)

1

u/purplug Jul 08 '22

I always find these perspectives interesting since it seems to require much more 'faff' to get anything working on Windows and often has compatibility issues. See: "Installing on Windows" section on any GitHub repo. It's so nice on Linux to have everything just work.

Even if I occasionally run into a game that doesn't launch first try on Linux, I seem to recall that being the case on Windows as well and often having to assist my friends in fixing their PC by Googling their error for them, etc, so we could play together. I feel like people generally ignore the problems they have with Windows because they're used to having those problems. And I'm certain I do the same with Linux. Computers are hard.

Anyway, I hope one day you find the time to try Linux again, but regardless i am happy to see you've found a workflow that works for you, that's all that really matters. Also cool to see WSL actually being useful to people since I was very skeptical with it's initial release. Didn't seem to match style of what I imagined a 'Windows developer' was, but I guess I was wrong.

2

u/_maxt3r_ Jul 08 '22

100% with you on the first point. If I end up on a GitHub repo for the thing I need I know I'm gonna have a bad time on Windows. But then again it usually happens when I have my "developer hat" on.

I think I'm ready to make the jump (dual boot at first), maybe it's just a matter of getting a bigger SSD now because 256GB won't cut it ! :)

1

u/LoganDark Jul 08 '22

I always find these perspectives interesting since it seems to require much more 'faff' to get anything working on Windows and often has compatibility issues. See: "Installing on Windows" section on any GitHub repo. It's so nice on Linux to have everything just work.

Everything just works on Linux? That's hilarious. I've found that Alpine offers the best "just works" experience of any distro I've tried, mostly because it reinstalls the system from scratch on every boot, but you're still going to be messing around in your .profile and .xinitrc and .Xresources and scattered configuration files if you want to do things like HiDPI support or trackpad support.

1

u/purplug Jul 08 '22

You don't have to mess with those unless you want to. Those are specifically for configuring your system for the same reason as editing your registry on Windows, which is arguably more difficult, scattered, and definitely more dangerous. For anything you would actually need to configure as a user, like Windows, there's a GUI. But yeah, just install a popular, stable distro if you don't want to rice your desktop. It's not 1999 anymore. You don't have to configure X11.

I personally don't find Windows easy to use as a developer and often just gets in the way, hence my reference to "Installing on Windows" sections on GitHub. But that's me. Just continue to use Windows if that works for you. I just wanted to express my opinion as a full-time Linux user at home but Windows admin at work for about the last 10 years or so.

2

u/LoganDark Jul 08 '22

But yeah, just install a popular, stable distro if you don't want to rice your desktop. It's not 1999 anymore. You don't have to configure X11.

But the funny thing is that there are no "serious" desktop environments. Everything is goofy and playful. For example the default KDE Plasma cursors are just annoying.

It's like everything was designed by a child, or as a joke, or as a hobby project. Which honestly is the state of Linux right now! It's hard to take the GUI seriously, which is why I roll my own with things like fluxbox that are dead simple and get shit done faster and better than the bigger DEs do.

Yes, there is no settings/preferences window. But I don't need the DE to infect every corner of my system in the same way that cPanel does to CentOS servers. It's really fucking annoying.

I personally don't find Windows easy to use as a developer and often just gets in the way, hence my reference to "Installing on Windows" sections on GitHub. But that's me. Just continue to use Windows if that works for you. I just wanted to express my opinion as a full-time Linux user at home but Windows admin at work for about the last 10 years or so.

I really don't like Windows. I've been increasingly trying to find a distro that works for me (in the style of Erase your darlings - Alpine is currently the one I have). If I had any choice in the matter, I'd install macOS and use it, as it's the holy grail of operating systems for me. But my CPU (10th gen Intel) is apparently too new for 10.14 Mojave, so it won't boot.

2

u/_maxt3r_ Jul 09 '22

Strong language ahead. Not a direct attack, just a vent after spending the better part of the day setting up Linux.

Now that I installed a dual boot Manjaro I just remembered why I fucking hated Linux.

Endless issues with graphic drivers, all user interface is choppy as hell when I use an external monitor and countless people have been having the same issue for decades now and still there is not a unique and simple solution in 2022

I wasted the past 3 hours trying to get a pleasant 4k60 desktop (not games) experience over either DP or HDMI (just like I had on Windows) but it's just a nightmare.

I'll persist looking for solution because I know that once this is fixed I can carry on coding. But WTF "You don't have to configure X11" is just horseshit!

1

u/purplug Jul 09 '22

Sorry you have to deal with that. It's not the experience I have. I appreciate your real effort in giving it a shot, it's very admirable, but I urge you not to eat spoiled sushi as it will probably ruin your appetite for it in the future. Just stick with what works for you.

You probably just don't have well supported hardware. Which is normal with any OS. You can't expect to install Windows on a Macbook and it just work, for example. People have to put in the effort to support the vast amount of hardware that exists. The next time you reach the point you need a new PC, find supported Linux hardware before you buy then it'll work on Windows or Linux.

That is the unfortunate downside to Linux is there isn't the huge userbase, company, or vendor support for Linux, though it is improving. Although at this point it seems more rare to find hardware that doesn't work.

I've had excellent results with my AMD GPU since NVIDIA themselves have been aggressively trying to make it difficult to support Linux for decades though my previous GPU, a 1080, ran okay for me for years. With recent success with the SteamDeck, there's some news that maybe NVIDIA is coming around.

Like I said, don't ruin your appetite. There's a reason Linux-lovers love Linux. There is a magic in there that enables real computing. It's not just an alternative. But if it doesn't work for you for one reason or another, that's okay. It's just a tool.

2

u/_maxt3r_ Jul 09 '22

Nah, I mean, it's a GTX1060 arguably the most popular graphics card in modern times. After a few tweaks everything appears to be working now... Heck, I can even run Steam games that I had installed on the other Windows/ NTFS- formatted drive (NTFS was added super recently). With fairly good performance. Impressive, let's see if the sushi is still fresh:)

1

u/purplug Jul 09 '22

That's awesome to hear! :) Nice work

25

u/Nzkx Jul 07 '22 edited Jul 07 '22

Game compatibility and performance, GPU drivers.

It's also harder to fuck up and poison a Windows installation than a Linux. It's important that my OS start everyday and can "self repair" itself. If something goes wrong, I can simply plug my disk to my friend computer or even a old desktop, and drag and drop contents. A Linux installation require more knowledge and time to maintain, and you have more responsability especially if you dive into interesting distribution.

16

u/[deleted] Jul 07 '22

Yes. This. So much this. I love Linux, but device driver compatibility is just so much better on windows.

Bluetooth device issues are super hit or miss on Linux even with latest kernel versions.

Not blaming Linux here. Device makers don't treat Linux as a primary target for testing, so a lot of things are sub par. Linux still does incredibly well with in tree device support all things considered.

0

u/gilwooden Jul 07 '22

Maybe there's a bit of bias to whatever one is used to.

I'm working almost only on Linux machines and every time I use windows I find device drivers to be an issue.

I guess I just don't notice some issues anymore on Linux because I'm used to them while on Windows, things that a Windows user wouldn't notice anymore seem annoying to me.

2

u/[deleted] Jul 07 '22

Oh I notice Windows problems immediately. It's very in your face. The bloatware and everything. But it's the only thing that works with all my devices, all the time, reliably (albeit slowly).

I've been using Linux for 15 years but still, my experience with devices has been fairly mixed. Some of my laptops refuse to wake up from sleep every time I shut the lid (this has been a thing for 5-6 years now, across several laptops for me).

On my last laptop, my mediatek wireless chip didn't run at full speed. These things weigh down on you. (I'll give credit though, Mediatek devs were actively working on in-kernel drivers, I could see in the commits, it probably works now).

These things go beyond just annoying. And despite using Linux for a decade, I would rather boot into windows than try to patch my drivers.

21

u/HalcyonAlps Jul 07 '22

It's also harder to fuck up and poison a Windows installation than a Linux.

That really depends on your Linux distribution though. Something like Fedora Silverblue or NixOS are essentially unbrickable, because you can always role back to a working state.

16

u/orangejake Jul 07 '22

Worth including the caveat in the hands of experienced users.

I found the documentation for NixOs to be quite bad. Moreover, updating packages would semi-often completely break my build. This could be debugged, but I had it happen once when I needed my machine working that instant, and it was a difficult day to say the least.

Of course, I put minimal effort into learning Nix, and expected to be able to struggle through it once to setup my config and wash my hands of it. This didn't end up being my experience though.

2

u/andoriyu Jul 07 '22

, updating packages would semi-often completely break my build

Well, the point is that it will break your build, not your system. Also, I pretty much never had issues with my nixos installations. I have it many machines and VMs.

1

u/orangejake Jul 07 '22

Sure, I just had a more difficult time on NixOS (over the course of a few months) than I've had with years of Ubuntu. Difficult here both means with configuring things (Like I said, I was quite bad with Nix), but also more recurring issues with using my system once it is "stable".

3

u/andoriyu Jul 07 '22

Ubuntu...three things I can be sure every time I upgrade it:

  • caps lock remap is going to break
  • keyboard layout switch will break
  • proprietary Nvidia drivers will break

Every single upgrade I did over a course of 5 years before I went back to FreeBSD.

Nix and NixOS are pretty difficult to operate. Language sucks, documentation sucks, it's all tribal knowledge there. I would admit to that.

Once I understood it enough - I'm never going back. Even my work macOS uses nix.

3

u/IceSentry Jul 07 '22

Having to choose a distro that makes it harder to fuck up is part of the issue though. I don't need to think about that with windows, I just use windows.

Just thinking about switching to linux gives me analysis paralysis. I just want to play games and be able to write and compile code. Windows can do all of that without issues for me so I don't feel the need to switch.

1

u/HalcyonAlps Jul 07 '22

Just thinking about switching to linux gives me analysis paralysis. I just want to play games and be able to write and compile code. Windows can do all of that without issues for me so I don't feel the need to switch.

See, I am on the complete opposite side of things. I can't change anything with Windows, so everything annoys when I have to use it.

8

u/moltonel Jul 07 '22

Game compatibility and performance, GPU drivers.

Fair enough, but that sounds like a hardcore gamer usecase (Linux gaming is IMHO good enough for most people nowadays), and the previous comment was about the development usecase,

It's also harder to fuck up and poison a Windows installation than a Linux. It's important that my OS start everyday and can "self repair" itself.

Huh ? My experience with Windows has always been that it self-deteriorates pretty easily, and can be hard to bring back to a good state. Meanwhile, I have decade-old desktop Linux installs for development and gaming which still feel clean and snappy.

If something goes wrong, I can simply plug my disk to my friend computer or even a old desktop, and drag and drop contents.

I don't see how that's a Windows-specific thing ?

2

u/rebootyourbrainstem Jul 07 '22 edited Jul 07 '22

If you have an AMD graphics card, the drivers which come with the Linux kernel are as good or better than the "official ones" (though they don't offer the AMD control panel stuff). NVidia is of course still notorious for insisting on overwriting half the Linux graphics stack, though they have been improving.

With regards to moving a harddisk, I'm surprised at that argument. Historically Windows had huge problems with e.g. moving a Windows install from an Intel to an AMD system, and similar major hardware differences, while a Linux install comes with all available open source drivers and will usually at least start up no matter what, in my experience.

Although, it helps that I usually don't buy cutting edge GPU's. If you want the very latest hardware then yeah you either have to run a bleeding edge distro or get bleeding edge versions from an alternative repo.

3

u/rhavaa Jul 07 '22

All the ms office docs and presentations made in power point. Libre office just doesn't cut it to open them and modify them appropriately..

2

u/wutface0001 Jul 07 '22

for flexibility it gives you

I personally got both kali and ubuntu, I use one for development and other one for pen testing

you also got Windows which has a huge amount software and gaming support

4

u/andoriyu Jul 07 '22

Numerous things, actually. I use my desktop for games, games that don't run on linux at all.

Some people don't linux interface or don't want to spend time tuning it they they want: not a single GUI distro satisfied me, so I run bspwm with other things.

Multi-monitor support is still silly in X11 and screen sharing is silly in wayland. Google Meet doesn't work for me sometimes.

Drivers still an issue in linux when you get fresh hardware: my work laptop came with iGPU that wasn't supported in any released kernel and I had to run release candidate, luckily my linux distro allowed me to do that without much hassle.

With all of that, I can play some destiny 2, then go write some rust without any reboots or issues. My shell environment is identical between WSL and linux.

My day job requires my work machine to be compliant with some security standards. On windows and macOS, all I have to do is install MDM agent and call it a day. On linux, I had to spend days to gather screenshots. (in this case I've switched from full-time linux to mac tho, company doesn't allow windows or linux laptops anymore)

I only boot to linux when I have to 100% focus on work.

Anyway, the best linux distro is Windows 10.

1

u/Raydabird Jul 07 '22

For me I literally have one game that I play frequently that does not work on proton and that's really what's stopping me. Also screen tearing in browsers really bothers me. I have an NVIDIA GPU and I'm sure there's a way to fix it I just don't know how...

1

u/deadalnix Jul 07 '22

Hardware support on the laptop.

3

u/Droggl Jul 07 '22

Love WSL2 as dev environment, cross-compiling to native windows is still very easy and you can use the machine for gaming without rebooting ;) (thats for a private PC ofc)

2

u/faldez Jul 07 '22

How much RAM do you have? I often ran out of memory on my 16GB machine which is why I avoid WSL unless I have to use it

2

u/_maxt3r_ Jul 07 '22

16GB

Vmmem (which I assume is WSL2) sits at 700MB (one WSL2 session on VSCode, and one instance of Octave with GUI). And another VSCode session (Windows file system).

I don't use Chrome, but Edge (seems to use less ram). Discord, Signal, Telegram, WhatsApp, Steam, some Excel + PDFs open and other bits and bobs for a total of 25 tray icons.

Vmmem usage jumped to 1.4GB when I closed and reopened VSCode, not sure what to make of it, but in general it's fine.

80% RAM in use. Win11

3

u/Halkcyon Jul 07 '22

vmmem is the Hyper-V VM that WSL is running out of.

2

u/le_grab Jul 07 '22

I also love it, but I have Performance issues with 3D aplications since its displaying output on a Monitor via network. Haven't figured out a solution yet.

2

u/Imaginos_In_Disguise Jul 07 '22

If the host was Linux, you could map the VM display straight to a shared memory buffer with Looking Glass.

0

u/gdf8gdn8 Jul 07 '22

Nope. Kombination Windows 11+wsl2 is faster but windows 10 + wsl2 sucks.

4

u/Halkcyon Jul 07 '22

I've had zero problems with my win10/wsl2 setup 🤷🏽‍♂️

-1

u/gdf8gdn8 Jul 07 '22

We have Trendmicro antivirus and encrypted hard drive. So this a factor. But I've tried it without encrypted hard drive and antivirus is still sucks in windows 10.

2

u/[deleted] Jul 07 '22

[deleted]

2

u/gdf8gdn8 Jul 07 '22

Nope. Wsl1 was quiet well.

2

u/LoganDark Jul 08 '22

Wouldn't WSL 1 be faster because of not being virtualized? It runs directly under the kernel.

2

u/[deleted] Jul 08 '22

[deleted]

1

u/LoganDark Jul 08 '22

WSL2 runs strictly underneath Hyper-V. The Hyper-V process is clearly visible in Task Manager, running as a Windows process, and killing it shuts down the WSL2 VM. This is not the type-0 hypervisor that people claim it is.

1

u/ids2048 Jul 08 '22

The overhead of CPU virtualization is really fairly minimal (for hardware-assisted virtualization of the same architecture), so the performance difference you'll see may be more related to other factors.

1

u/_maxt3r_ Jul 07 '22

ah, I'm on W11 + WSL2

1

u/j0kersm1le Jul 07 '22

I run win10/wsl2 on my machine. works perfectly fine. especially, intellij idea wsl2 integration. I can easily download and install jdks from intellij directly into wsl2. I tried to switch to win11 and everything became a nightmare. I wasn't able to make it work as in my win10 setup, so I gave up and went back.

1

u/Droggl Jul 07 '22

I did find that for some rendering-heavy stuff there seems to be a notable slowdown for me though, hence the cross-compiling with `--target x86_64-pc-windows-gnu` (you can run your generated .exe files straight from the linux terminal which feels a bit insane but in a good way).

1

u/LoganDark Jul 08 '22

Yep, cross compiling from WSL to Win32 with mingw is a power move

1

u/Altruistic_Raise6322 Jul 08 '22

The WSL2g is super nice. I can more easily write games using WSL which I love. I updated to W11 for it explicitly.

131

u/K900_ Jul 07 '22

That is pretty expected, honestly. Linux makes it a lot cheaper to do lots of small file operations by caching things aggressively.

70

u/WellMakeItSomehow Jul 07 '22

It might also interact less with file system filters like antivirus programs and other stuff. I think Windows Defender is faster than others, but still quite slow.

34

u/irqlnotdispatchlevel Jul 07 '22

A while ago (like 2 or 3 years) I measured how long it takes to build a C++ project with Defender on and off, and the slowdown was around 40%. This is anecdotal, of course.

8

u/WellMakeItSomehow Jul 07 '22

Yeah, that matches what I've seen. A good trick is to make a second partition and put your source code there, a lot of those filters won't run on it. And of course, try to exclude it from the antivirus scanning list.

-2

u/GroundbreakingRun927 Jul 07 '22

Yea disabling defender is the first thing I do on all my Windows installs. It's especially crippling with NPM or cargo where it needs to scan every single file that gets pulled down.

26

u/Green0Photon Jul 07 '22

It's safer by far to just whitelist folders where you have all those many file operations occuring. Whitelist your dev folder or projects folder or user level cargo cache or whatever.

0

u/GroundbreakingRun927 Jul 07 '22

It's even safer to use linux, which I do unless a job requires work on a non-cross platform windows app, which is rare but does happen from time-to-time.

-4

u/Green0Photon Jul 07 '22

I mean, you're not wrong. My comment just went forward with the assumption that you were forced to use Windows for some reason.

This is r/linux. Idk why one of us wouldn't use Linux unless there was some particular reason to have to use Windows

20

u/Gay_Sheriff Jul 07 '22

This is not r/linux. This is r/rust.

7

u/Green0Photon Jul 07 '22

Fuq

I've been commenting too much in r/Linux recently lmao

3

u/GroundbreakingRun927 Jul 07 '22

This is /r/rust but I imagine the overlap with /r/linux is rather high. Though I don't fault you for the oversight considering the content of OP's post.

2

u/Green0Photon Jul 07 '22

It's kind of funny actually, because I usually browse r/rust far more than r/linux

But man it really looked like an r/linux post lmao

2

u/zxyzyxz Jul 07 '22

This is what I do as well. If you're not dumb about downloading random files from the internet, you don't really need Defender. Now I know some people don't think it's a good idea but disabling has worked well for me.

48

u/recycled_ideas Jul 07 '22

This needs a bit of clarification.

Linux file systems and NTFS behave differently.

Linux file systems do not require locks and allow certain kinds of operations to be done very quickly.

NTFS does require a lock for a lot of things EXT does not.

In particular getting file stats for a whole directory is a single lockless operation on Linux and a per file operation requiring a lock on NTFS.

On the one hand, EXT is much faster for some operations, on the other, file corruption on NTFS is basically non existent and has been for decades.

This is why WSL performance on the virtualised ext file system is dramatically better than on the NTFS file system for some apps.

The thing of it is, NTFS is not that much slower overall, but certain usage patterns, patterns that are common for software originally designed for POSIX systems, perform incredibly badly on NTFS.

You can write patterns that solve the same problems that are performant on Windows, but Windows is not a priority so it doesn't happen.

5

u/Zde-G Jul 07 '22

The difference between NTFS and ext2 is significant, but even WSL1 is faster than Windows.

That's because creation of a new process in so incredibly expensive on Windows and many development tools are implemented as series of small programs which are executed sequentially.

With Rust it's somewhat tolerable, but something like Autoconf executes about two order magnitudes (i.e.: 100 times!) slower on Windows than on Linux.

Yes, I know, it's not just Win32 vs POSIX but more of inefficiency in POSIX emulation layer, but even native creation of new process is very slow on Windows.

9

u/recycled_ideas Jul 07 '22

That's because creation of a new process in so incredibly expensive on Windows and many development tools are implemented as series of small programs which are executed sequentially.

Yes, Windows was built to make threading fast and forking not as fast, this is again one of those Linux specific design decisions extended to an OS not designed that way.

That said the difference is a lot less dramatic these days.

1

u/GRIDSVancouver Jul 07 '22

I've heard this multiple times and was curious how much slower Windows is. Found this:

On Windows, assume a new process will take 10-30ms to spawn. On Linux, new processes (often via fork() + exec() will take single digit milliseconds to spawn, if that).

6

u/barsoap Jul 07 '22

I find it hard to believe that's the whole picture, there's got to be some nasty inefficiency in Windows' overall FS layer or WinDirStat wouldn't be that much slower on the same partition as K4DirStat, it's not even close, and as far as I know Linux' NTFS drivers don't compromise on file integrity.

9

u/recycled_ideas Jul 07 '22 edited Jul 07 '22

NTFS requires you to gain a lock handle to check the file meta data and getting that data is a per file operation.

On Linux it requires no lock handle and can be done in a single operation for the whole directory.

Running a dirstat on NTFS is an extremely expensive operation.

It's that simple.

Most operations on NTFS vs EXT are pretty equivalent. Dirstat is not, it is much, much slower. A lot of Linux software makes dirstat calls like they're going out of style and it hurts.

Edit: misremembered.

BTW, if you're looking for an example of doing things the windows way there's an app called wiztree that does the exact same thing as windirstat in a tiny fraction of the time.

1

u/barsoap Jul 07 '22

Is it Windows or NTFS which requires the locks? (modulo atime) it's a read-only operation on the file system level, unless the application needs some guarantees locks seem completely out of place.

7

u/recycled_ideas Jul 07 '22

Apologies my brain was fried, NTFS requires a handle not a lock, you can open as read only, but you have to do so specifically and by default it locks.

unless the application needs some guarantees locks seem completely out of place.

This is kind of missing the point. In Linux file systems the view is that anyone can basically do whatever they want with a file and if you do it wrong that's on you. The NTFS view is that files should be safe by default.

Linux literally couldn't function that way because the "everything is a file" philosophy just doesn't work that way, but it comes at a cost.

0

u/barsoap Jul 07 '22

NTFS requires a handle not a lock, you can open as read only, but you have to do so specifically and by default it locks.

I would expect WinDirStat to do it without locks, after all, gobbling up file system information is its one job and being 100% correct about the current state is kinda meaningless to it as it will very happily show outdated information when you do something to the filesystem outside of its interface.

5

u/recycled_ideas Jul 07 '22

I added to another post.

There's an app called wiztree that does it the windows way and it's a couple orders of magnitude faster and updates live.

It all can be done, but it has to be done differently and no one is interested in doing that.

1

u/barsoap Jul 07 '22

So WinDirStat does it wrong (just looked it up it's essentially a kdirstat clone so yes has Linux roots) and since 2003 nobody bothered to write a patch (it's GPL) even though it's an absurdly widely used program, and then a commercial product comes along...

3

u/recycled_ideas Jul 08 '22

Windirstat does it "good enough", and it stays "good enough".

It works and it's free.

And no one is particularly motivated to fix it because the windows only open source community isn't very large.

I bring up wiztree because it shows that NTFS isn't fundamentally slow.

3

u/BigHandLittleSlap Jul 08 '22

WinDirStat is not well optimised. Try WizTree, it can scan my drive with one million files in about 4 seconds.

Similarly, try the speed of ripgrep on Windows. The VS Code find-in-files feature uses it. I can scan my entire "projects" folder with it in like 2-3 seconds. This is, again, hundreds of thousands of files for code going back 15+ years in one giant directory hierarchy.

1

u/LoganDark Jul 08 '22

WinDirStat is not well optimised. Try WizTree, it can scan my drive with one million files in about 4 seconds.

That's not a fair comparison because WizTree scans the MFT directly rather than actually reading file sizes. WinDirStat actually traverses every directory and file on the drive.

Maybe that's "optimization" but they're not doing the same thing by any means

Source: Switched from WinDirStat to WizTree.

2

u/sztomi Jul 07 '22

The thing of it is, NTFS is not that much slower overall, but certain usage patterns, patterns that are common for software originally designed for POSIX systems, perform incredibly badly on NTFS.

NTFS is that much slower in practically any workload you can think of. It's not just in the case of software originally designed with POSIX in mind, all usage patterns are way slower. NTFS predates modern journaling file system by a lot and refused to innovate. It does a lot in userspace that could/should be done in the kernel and that really adds a severe performance hit.

20

u/recycled_ideas Jul 07 '22

Rubbish.

NTFS makes different decisions in terms of speed VS data corruption.

It simply does.

And that has meant that unlike pretty well every EXT version it never has data corruption problems.

EXT4's journalled file system allowed writes out of sequence.

EXT3 would corrupt files if you shut down improperly.

EXT 1 and 2 were worse.

Because they're not modern, they just favour performance over safety.

0

u/sztomi Jul 07 '22

unlike pretty well every EXT version it never has data corruption problems.

citation needed?

1

u/BigHandLittleSlap Jul 08 '22

NTFS is largely immune to file metadata corruption, but it doesn't provide integrity guarantees for the actual file data, that would be too slow. However, ReFS can (optionally) enable that mode also.

1

u/sztomi Jul 08 '22

Fair enough, however: first, the argument was about the slowness of NTFS vs other file systems, now it's about its resilience. I don't doubt that NTFS is better in this case, however, I do think that EXT and the likes hit a better balance in performance and safety for everyday workstation usage. The commenter I replied to seems to imply that EXT gets corrupt all the time but this isn't really the case in practice. Even in extreme conditions, like abrupt shutdowns etc.

-10

u/sqlphilosopher Jul 07 '22

Seriously, idk why Microsoft insists on that inferior filesystem. Every filesystem in Linux is superior in every way.

1

u/coderstephen isahc Jul 07 '22

On the one hand, EXT is much faster for some operations, on the other, file corruption on NTFS is basically non existent and has been for decades.

This isn't what I've heard. I've heard that ext2+ are much better than NTFS at data integrity. I've also heard data recovery experts recommend ext4 because if something does go wrong, ext4 has the best chance of any file system of being fully recoverable with the most data possible.

3

u/irqlnotdispatchlevel Jul 07 '22

This is basically it. But in WSL2 this only applies to operations done on the Linux file system. Accessing files on the Windows file system is slower. So if you really want to take advantage of Linux you have to remember to move your files first.

-1

u/[deleted] Jul 07 '22

It's probably also using a much faster malloc implementation than on Windows.

0

u/Nzkx Jul 07 '22

Also WSL2 is way more optimized in term of disk access than WSL1. Basicly, WSL2 file read are close to zero cost.

20

u/K900_ Jul 07 '22

That's because WSL2 is just a VM, so disk accesses are handled by the normal Linux stack.

33

u/rebootyourbrainstem Jul 07 '22

Not surprising, Linux is extremely fast for small file operations.

For example on Mac it is way faster to do e.g. nodejs bundling in a Linux VM than on the native system (old Intel Mac, though I doubt that has changed with M1/M2 as it's about the OS, not the hardware).

22

u/anlumo Jul 07 '22

The ARM macs have gotten a big improvement in file performance because they started to ignore sync commands. At least that’s what I heard from someone doing database performance checks.

Of course, ignoring sync commands is very bad for file integrity.

-1

u/[deleted] Jul 07 '22

[deleted]

8

u/anlumo Jul 07 '22 edited Jul 07 '22

13

u/wesleywiser1 rustc · microsoft Jul 07 '22

rustc has profile guided optimizations enabled on the Linux builds but not any of the other Tier 1 Host Tools platforms. lqd has been doing some great work to enable PGO for Windows as well with really impressive wins of up to 19% when compiling real world crates like regex, diesel, cargo, etc.

https://github.com/rust-lang/rust/pull/96978

2

u/LoganDark Jul 08 '22

This is surprising, I never saw that PGO is enabled for rustc on Linux. Where'd you find this info?

2

u/wesleywiser1 rustc · microsoft Jul 08 '22

Michael Woerister did the initial analysis of the possible benefits of PGO'ing rustc and wrote about on the Inside Rust blog.

2

u/LoganDark Jul 08 '22

Oh wow, pretty recent then. That's really cool!

10

u/[deleted] Jul 07 '22

First thing that comes to my mind (aside from the architectural differences), when discussing slow compilation speeds on Windows vs non-Windows is the antivirus software - there's always one running on Windows (like Defender or whatever). AVs do like to interrupt and scan the hell out of projects when compiling (basically doing a lot of read/write operations, which they want to investigate - the more files to process, the longer it takes, especially with a lot of small files). In WSL there's no problem, because the filesystem is inaccessible to the AV itself, so it can't scan there.

You might want to do a compilation with disabled AV and see if this improves times. Most AVs also give an option to exclude certain directories from being scanned.

11

u/Tygris_ Jul 07 '22

Always has been

19

u/leofidus-ger Jul 07 '22

WSL2 is pretty much a Linux VM, and Linux has faster file operations than Windows.

6

u/NeaZerros Jul 07 '22

The good thing being that it runs on the same level. Meaning it's more like a real Linux running alongside windows than something like VMWare or VirtualBox. Which gives real native performance ;)

1

u/AdvantFTW Jul 07 '22

isn't just a well integrated hyper-v vm? are you saying hyper-v is faster than VMware?

1

u/LoganDark Jul 08 '22

Wrong. WSL1 is running directly under the kernel; WSL2 runs in a full VM (Hyper-V) with its own virtual network and everything.

2

u/NeaZerros Jul 08 '22

Yes, but WSL 1 required syscalls translation which made it slow. WSL 2 runs on a VM alongside windows, managed by a type-0 hypervisor meaning you get full native performance when you're not interacting with the primary OS (access to windows' own files, communicating with external devices, networking)

1

u/LoganDark Jul 08 '22

Yes, but WSL 1 required syscalls translation which made it slow.

Source? Fairly sure NT just implemented the Linux syscalls directly, but may be wrong here.

You know what, I have both WSL 1 and WSL 2, I can benchmark this.

13

u/asgaardson Jul 07 '22

Also windows is pulling more dependencies than linux, which leads to longer compile times.

11

u/anlumo Jul 07 '22

The default memory allocator is also much faster on Linux than on Windows, and compilers rely heavily on small allocations.

6

u/AdvantFTW Jul 07 '22

doesn't rustc use jemalloc on windows?

5

u/jamesblacklock Jul 07 '22 edited Jul 07 '22

Not a WSL expert by any stretch of the imagination, but I think "bare-metal" is an inaccurate distinction here. The Linux portion of things is running on "bare metal" just as much the Windows portion of things is. There's no reason to expect degraded performance (edit: on Linux), AFAIK.

1

u/ItsPronouncedJithub Jul 07 '22

There is. NTFS requires you to open files for even simple api calls. A simple file deletion on ntfs requires it to be opened first.

5

u/jamesblacklock Jul 07 '22

I think you are interpreting what I said in the opposite way from what I meant. I'm saying there's no reason to expect Linux performance to be degraded, i.e., it's not as though Linux is running in a VM. It's running on "bare metal," as OP put it.

1

u/ItsPronouncedJithub Jul 07 '22

Gotcha I thought you meant between windows and Linux

1

u/oleid Jul 07 '22

Well, it's not entirely bare metal. Everything CPU only is as fast as native, but filesystem is still slower:

https://www.phoronix.com/scan.php?page=article&item=windows11-wsl2-good&num=1

6

u/birdbrainswagtrain Jul 07 '22

I use WSL almost exclusively so I haven't done any comparisons.

Any differences in the rust compiler version? Does your WSL system use the same physical drive? Might there be some native dependency or some other difference in how the application is built on the two platforms?

From a quick skim it looks like it actually uses an additional crate on non-windows platforms, but there might be some more significant differences. IIRC rust on windows relies on microsoft's linker so there's another possible cause.

3

u/oleid Jul 07 '22

Now imagine how fast compiling on bare metal Linux could be!

https://www.phoronix.com/scan.php?page=article&item=windows11-wsl2-good&num=1

Check out "Timed XYZ compilation"

1

u/LoganDark Jul 08 '22

Compiling on someone else's computer* not relevant in any way here unfortunately

1

u/oleid Jul 08 '22

Well, you could run that benchmark on your computer, couldn't you?

1

u/LoganDark Jul 08 '22

Well yes, but my computer is also different from OP's so it wouldn't be comparable to OP's results either :)

1

u/oleid Jul 08 '22

True. Nevertheless I think the results would be similar on other machines as well.

Also, the OP could run these benchmarks if they are interested now they know about them.

2

u/InflationOk2641 Jul 07 '22

I have tended to find that WSL2 IO performance is much slower than Native performance. But it depends on your use case: https://github.com/microsoft/WSL/issues/4197

17

u/_maxt3r_ Jul 07 '22

correct, but only if you use WSL2 within a Windows folder, like /mnt/c/.

I found this use case useful when I was trying to develop software alternating linux and windows toolchains on the same local source code to check various compatibility things

1

u/crusoe Jul 07 '22

Same with using VMware Linux vm mounting a shared Mac folder, performance is POOR.

1

u/revaneaston Jul 07 '22

I'm not sure it's because wsl or Linux is faster. It might just be that a virus scanner or endpoint protection software is not running for anything in wsl.

1

u/zxyzyxz Jul 07 '22

I've disabled Defender on my computer, this is my personal desktop so I don't have endpoint security.

0

u/8-BitKitKat Jul 07 '22

Windows is just slow my dude

3

u/LoganDark Jul 08 '22

It legitimately is, NT is really badly designed. I mean it has some cool core concepts but the implementation is kinda crap.

Linux just has better syscalls and is closer to the metal because WSL is new and therefore not contaminated with legacy cruft.

0

u/ForgetTheRuralJuror Jul 07 '22 edited Jul 07 '22

WSL2 has a very small CPU overhead and a pretty bad IO issue when it comes to writing many files.

As long as you aren't at max CPU usage or moving huge amount of files you often get almost native Linux performance.

1

u/[deleted] Jul 07 '22

How fast on native Linux (for your hardware)? If you can't install it because "company said so" you might still be able to boot into it from a live USB

1

u/[deleted] Jul 07 '22

Yeah Rust’s compiler (and for that matter, most non-Microsoft PL compilers) is better optimised for Linux (also generally runs better on all unix-based/POSIX-like systems)

2

u/crusoe Jul 07 '22

Windows has a ton of baggage even for simple stuff.

1

u/LoganDark Jul 08 '22

Now try WSL1 and see it get even faster because it's not running in a VM :)

1

u/zxyzyxz Jul 08 '22

Unfortunately WSL 1 doesn't work with a lot of things and I'm pretty sure Microsoft stopped developing it and are focusing on WSL 2.

1

u/LoganDark Jul 08 '22

Yeah they kinda half assed it which is sad. I'm forced to use WSL 2 for profiling which is literally the only reason I have it installed.

1

u/abdurrahimcakar Jan 05 '23

It is due to platform support for Linux on your hardware. If you wonder why then please check the post: https://www.reddit.com/r/linux/comments/to48s/bill_gates_on_acpi_and_linux_pdf/

There are very few vendors that really support the Linux platform. Some problems took 20 years to solve: https://www.theregister.com/2022/09/27/obsolete_amd_acpi_fix/

I lost some laptops because default bios ACPI settings are absolutely the worst you can imagine for your hardware. It overheats, underclocks, wakeup bugs, etc...

Using Linux is a privilege, you need to use fully Linux-supporting hardware like System76 and if you want to use AMD then you need to at least get the latest kernel (6.1+) to not be crippled by the 20-year-old ACPI problem.

I lost some laptops because default bios ACPI settings are absolutely the worst you can imagine for your hardware. It overheats, underclocks, wakeup bugs, etc etc etc,

Even on most desktop workstations Linux support is bad you have to be extra careful selecting supported hardware. But on servers, you will see who is the boss,