Comment by marsrover
7 years ago
I develop on Windows 10 because I’m a .NET developer and really like the idea of WSL. But the more I use it the more frustrated I become by its file access performance. I started off using it for Git but now I just use Git bash in Poweshell (which also annoys me with its slowness).
I haven’t developed on an actual *NIX machine in years but recently I deployed something to my DO VPS and it “built” (php composer) in what felt like 1/100 of the time it was taking on my computer, whether running the Windows binaries in Powershell/CMD or the Linux binaries in WSL. Although I will say WSL is slower.
In fact, it was so fast that I’m about to call Microcenter and see about picking up a Thinkpad to install Linux on.
A major performance improvement is adding the working folders for my coding projects to the exclusion list of whatever antivirus solution is running. On low-specced machines I disable AV entirely, because I feel these days it is mostly snake oil anyway with zero days being commonplace.
Uhh what? Software is probably more secure now than ever before. I don't think AV software is snake oil at all.
UEFI Secure Boot, mandatory signed binaries, and Windows Defender (XProtect on macOS), have contributed more to protecting from malware than 3rd party anti-virus. Although I think the existence, cost, and PITAness of 3rd party anti-virus might very well have contributed to motivating the OS vendors into securing their products better.
4 replies →
Software maybe, but that has precious little to do with AV.
4 replies →
To give another data point, for the software I'm developing (https://ossia.io/, a few hundred thousand LOC of modern C++ / Qt), a full build, with the same compiler version (clang-7), on the same machine, on the same pci-express NVMe disk takes 2 to 3 times slower on windows than on linux.
every time I have to build on windows I feel sad for all the developers forced to use this wretched environment.
For C++, on Windows I use MSVC compiler, and I'm usually happy with its performance. If your clang supports precompiled headers, try enabling them. This saves CPU time parsing standard headers, but also saves lots of IO accessing these random small include files, replacing the IO with large sequential read from the .pch.
I already use PCH, and the same project built on MSVC is even slower.
I have a similar experience. I'm a developer on a product that has both C and C# components. The C component runs on both Windows and Linux and is by far the larger of the two while the C# GUI component is Windows-only.
Our main workstations are Windows but we also have a shared Linux development VM on our group's VM host. The VM host is not very powerful, it's a hand-me-down machine from another group that's around 7 years old at this point, with a low-clocked Bulldozer-based AMD Opteron CPU and spinning rust storage. In comparison my workstation has a 4th-gen Core i7 processor and a SATA SSD.
Despite the fact that my workstation should be around 2-3x as fast per thread and have massively better disk I/O the VM host still builds our C code in less than half the time. If I didn't have to maintain the C# code and use MS Office I'd switch to Linux as my main workstation OS in a heartbeat. (Note that the compilation process on neither platform uses parallel compilation so it's not that our VM is farming the compile out to more cores.)
In a similar situation - I've had reasonable success in Linux developing a .net framework c# app in VS Code with Mono from the Ubuntu PPA. Almost everything works but for the odd project calling native Windows DLLs, so I keep windows around for manipulating VS projects and compiling these oddities. Most dev can happen in Linux though.
In my case we use a closed-source commercial UI library very extensively whose vendor has previously stated they have no interest in supporting Linux or WINE so doing C# dev on Linux is totally out of the question for me, unfortunately. The company I work for has a long-term strategic initiative to transition to an entirely web-based UI so eventually we may be able to remove the C# code but that's still years off for my group.
(In retrospect tying ourselves to a closed-source library like that was a mistake; if I could go back in time and put us on a different path (using the technologies available at the time) I would have gone with C++ and Qt instead which would have allowed for cross-platform development and deployment. Not to mention that because Qt is open-source (even if we would have had to buy a proprietary license for it at the time) we could fix any bugs we encountered ourselves, unlike our current UI library where we just need to come up with work-arounds until the vendor can get around to fixing them. But these decisions were made before I was hired so I just have to live with them.)
I am not a C# dev, so please bear with me.
So you have you core business logic and algorithms written in C and only the front end/GUI uses C#? Can you cleanly separate the two (via MVVC or a variation thereof)?
Does the whole application runs on C# and you have RPCs between the two? What does that mean for performance?
Cheers and thanks for any Insights about your setup.
It's a pretty classic client/server setup (not too different from modern web apps, actually). The C code is the server and the C# code (which is actually a plugin to another application written in C#) is the client. The C server can run independently of the C# clients but isn't very useful (to our customers at least) by itself.
Most of the C# code's responsibility is taking user commands from the plugin's host application and converting them to messages sent to the C server for further processing, which isn't very speed/latency sensitive most of the time since it only has to operate at user-perceivable timescales and on small amounts of data. The remainder of the C# code is some custom UI controls and dialogs.
The network communications (if you squint hard enough) somewhat resembles REST with custom binary protocols instead of HTTP and JSON; if REST were in style when this code was first written (around 10 years ago) it almost certainly would have been used for the network/message layer instead.
Do you take the buffercache into account? If the server has more RAM unused by processes it probably uses it as a cache, which can be 3x quicker than a SSD.
Both machines should have sufficient memory to cache the entire codebase (including all header and library files) in RAM.
Why not flip to linux and run Windows in a VM?
This helped me: https://github.com/Microsoft/WSL/issues/1932#issuecomment-40...
Microsoft made some change a year or so ago that brought more of WSL into Windows Defender's view.
Windows Defender is an abomination. It makes file operations on regular Windows also extremely slow. For example unpacking the Go 1.11 zip which is 8700 files takes a second with my PCIe SSD with Windows Defender disabled. Enable it and the extraction time rises to several minutes.
I wonder if their "real time protection" is making a network request every time you open a new file.
Can I plug System76 as an alternative? I feel like it's important to purchase Linux-native hardware. Microsoft has largely prevented competition in this market, and I think more viable options would benefit consumers. Also, S76 has pretty good hardware.
Thanks for the heads up (S76) but Linux runs on pretty much anything these days. This laptop is a Dell Inspiron with a 17" touch screen and lots of sensors. I'm running Arch Linux on it and everything is supported out of the box. The only tweak I have made towards hardware is changing the driver in use for the Synaptics mouse, which dmesg mentioned and will probably become the norm soon anyway.
There really is no such thing as MS native only anymore. I got Linux on here without accepting any obnoxious licenses and my laptop's price was partially subsidised by all the crap that I never even saw. To be honest, I'm not sure what the exact price breakdown really is on this thing but I do know that MS did not get in my way.
Dell are pretty Linux friendly, for example to update firmware I copy the new image to my /boot partition (EFI) and then use the built in option at boot to update the firmware - simples! No more farting around with turning swap into FAT32 for a while and a FreeDOS boot disc.
The issue is not whether Linux can be made to run, the issue is whether you are subsidizing Microsoft for that privilege.
3 replies →
I'll plug the Librem 13/15. I have the 13 and I'm very happy with it (initially it had a bug in the firmware so my NVMe SSD that I bought separately wasn't bootable, but they fixed it very quickly).
+1 for S76 HW guts, but I find their laptop chassis to have been really flimsy in the past - where screws fell out and into the case of 3 laptops.
They were, in the past, using CLEO as an OEM....
They came out with that custom steel and wood case all made in the USA recently, but don't know if they are building their own laptop HW these days.
I got a Galago Pro recently, because my previous netbook fell apart. The construction on the Galago Pro is quite solid, I believe; getting it apart was a bit more challenging than I am used to. However, the laptop is still being manufactured by CLEVO, and as one consequence of this, the battery life is pretty limited (I was aware of this drawback before purchase). I believe that, as the sibling poster mentions, they are bringing their design and manufacture in-house, and that subsequent revisions will be an improvement. I don't find the issue to be hugely limiting, and I am personally willing to forgive quite a lot to have (1) no Windows key, and (2) non-soldered RAM.
They are going to be building laptops. Not sure if they have sold any of the ones developed in house, but here's the related press release.
https://blog.system76.com/post/159767214983/entering-phase-t...
Sadly they are overpriced to hell.
Curious just how feasible doing . NET dev in Linux would be? Is it a non start? Is it inconvenient and rough? Is it fine if you give it enough love?
If I only messed with .NET Core I think it would be fine. I already use JetBrains Rider in place of VS.
The problem is that many systems still rely on .NET Framework which is a non start on Linux.
Also stuff like this:
https://github.com/dotnet/cli/issues/3093#issuecomment-44343...
Trust, is an issue.
and their response is even worst:
https://github.com/dotnet/cli/issues/10497#issuecomment-4494...
Sadly, I thought they would have fixed it and not ignore it.
Depends on if you're just writing pure libraries, or actually doing interesting things like UI or linking to 3rd party drivers.
I think the experience with mssql is better on linux now, but I imagine anything slightly outside the box db-wise may break you.
I know SQL for linux's docker image has been a breeze to work with, even in docker for windows. Also, SQL Operations Studio (electron based) is catching up to SSMS.
It's the lack of visual studio that is often the nonstarter.
Jetbrains’ Rider IDE is now so mature that I use it as a better Visual Studio even on Windows. It also runs on Mac and Linux. Great code manipulation, navigation and refactoring tools, and great support for adjacent technologies like build and test tools for both the .net code and web front-ends.
3 replies →
You can get by with vscode for a lot, but not everything I think.
7 replies →
Reasonable. .NET Core is obviously fine, but even .NET Framework stuff is largely runnable with up to date Mono, as MS is slowly pushing lots of previously 'system' libraries into NuGet. WPF is the only notable big dealbreaker.
Web stuff is fine.
> I started off using it for Git but now I just use Git bash in Poweshell (which also annoys me with its slowness).
This may not be a WSL issue. You don't want to mix Windows git (what you're calling git-bash) with Linux git (or MSYS2 git). Even a git status will cause them to trample on each other in ways I don't yet fully understand, and that will also slow them down very significantly as one tries to process a repo the other one has previously accessed. Pick one and stick with it for any given repo.
You may actually see better performance via docker or vm for linux under windows. Also, if you're using or can migrate to .Net core it works pretty well there.
I'm using containers for local services I'm not actively working on, even though the application is being deployed to windows, because it's been easier for me. I'd actually prefer Linux host at work, but there's legacy crap I need.
I do work remotely sometimes on my home hackintosh though.
Same. I changed to cygwin for my git workflow because WSL is just too slow.
If you had used WSLGit (https://github.com/andy-5/wslgit), you could use Cyg-Git (https://github.com/nukata/cyg-git) instead. It provides a "Git for Windows" virtually for Go and VSCode. You only need Cygwin and its packages, including Cygwin's git.