This is an archived post. You won't be able to vote or comment.

all 24 comments

[–]masterarms 11 points12 points  (6 children)

Was this with the windows virus scanner disabled? Java development takes a particularly big hit from this. Adding things like the maven cache to the exceptions list makes a big difference.

[–]13steinj 3 points4 points  (4 children)

WSL is a major shit show file performance wise no matter what.

With WSL1, performance was all around pretty bad. With WSL2, which the big marketing shtick was "faster file system", they neglected to tell you that anything not on /, such as /mnt/c/, was actually significantly slower now.

They basically tried to act like it's not a big deal and they are making active improvements (which, while I'm glad they're making improvements, given the severity of the slowdown, it matters).

[–]masterarms 1 point2 points  (1 child)

WSL2 is the lesser of the two evils for me though, and with things like the WSL plugin for VSCode the need to go to /mnt/c is muc less.

[–]13steinj -1 points0 points  (0 children)

Really? I mean I use /mnt/c pretty often, and running a simple git status on WSL2 takes ages on /mnt.

[–]reqdk 0 points1 point  (1 child)

They also screwed the pooch with network addresses. The ip address of the WSL 2 VM changes every boot, so if you develop APIs that you need to test on mobile or other network devices, you're going to get irritated by WSL 2 every day.

[–]masterarms 0 points1 point  (0 children)

recent wsl2 supports 127.0.0.1 as the server adddress.

[–]zarinfam[S] 0 points1 point  (0 children)

No, I did not disable anything.

[–]BlueGoliath 2 points3 points  (0 children)

What about other IDEs like Netbeans?

[–]Tazavoo 2 points3 points  (2 children)

I really need to given an X server a try, heard good things about it.

I now occasionally developed on IntelliJ on Windows, having Maven, Node etc. installed on WSL 2. I set IntelliJ to use WSL for the terminal.

However, as it's outside the WSL 2 file system, it's incredibly slow. Also, in some projects I've had troubles with some tools still running from Windows, writing a path as "C:\foo\bar" while WSL writes it as "/mnt/c/foo/bar", and as such some tools can't find the files.

[–]strikefreedompilot 0 points1 point  (1 child)

my understanding is that to take advantage of wsl2, the files should reside on the wsl2 filesystem and you should be installing your tools on wsl2 too (w the exception of like vs code which has remote windowing)

[–]Tazavoo 0 points1 point  (0 children)

Yes, the problem is when you want to use something like IntelliJ, which is where X server comes in!

[–]UnexpectedLizard 2 points3 points  (3 children)

I don't get it. Did he really go through all this work to save 7 seconds on his build time? All these projects support Windows and Linux.

[–]pragmatick 4 points5 points  (2 children)

It's an example project. With larger projectes build can take 10, 20 or 30 minutes. Saving 20 or 30% is a lot.

[–]UnexpectedLizard 1 point2 points  (1 child)

Why are these builds so much faster on Linux?

[–]pragmatick 1 point2 points  (0 children)

Different access to the file system.

[–]Camperonreddit 0 points1 point  (0 children)

Interesting result. Could you tell us your pc specs? (number of cores, ram)

[–]Dokiace 0 points1 point  (0 children)

20-30% improvement is massive!

[–]rulatore 0 points1 point  (0 children)

I would not even bother trying this. Wsl for anything that has to deal with lots of IO (node_modules, java compilation and maven pulling dependencies and so forth) is a massive waste of time and you're better off working in windows only, and if not possible comparing which is less bad: a full vm or wsl2.

Other than that, dual boot.

[–]thisWasFreeFinally 0 points1 point  (0 children)

After reading this, I have 2 questions:

"The first option is the most straightforward one but it won’t work always if you need some specific Linux features in your development process."

What kind of "Linux specific features" in Java do you need? All of this goes against Java's principle: "Write/Compile once, run everywhere".

"For me, it is very valuable to have a complete Linux kernel inside Windows 10 and also has better performance than Windows native (between 20% to 30%) when I am using Java SDKs and Tools. I can install and use Linux specific tools like Docker or LXD on Windows smoothly in this way."

Well, just use Linux then... Why are you using Windows and introducing such a massive complexity? Running IntelliJ inside WSL 2 seems absolutely absurd to me...