Jump to content

Why does my code compile slower on windows compared to Linux.

Alex MR46

So I have been learning front end web development for about 6 months now. Currently I am using Next.js (A react framework for developing single page Javascript applications) to build a website. My brother who is a software engineer told me to use Linux since it compiles code much faster than windows which speeds up development process. 

Can someone please explain why is it that way? And would I get the same compiling speed as Linux if I used WSL on windows?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Mostly how Windows deals with IO and its filesystem, which is pretty slow. Using WSL would be somewhere in between both, but closer to native Linux performance (since it's pretty much a VM by itself).

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

24 minutes ago, Alex MR46 said:

So I have been learning front end web development for about 6 months now. Currently I am using Next.js (A react framework for developing single page Javascript applications) to build a website. My brother who is a software engineer told me to use Linux since it compiles code much faster than windows which speeds up development process. 

Can someone please explain why is it that way? And would I get the same compiling speed as Linux if I used WSL on windows?

 

 

Personally I happen to know that Linux is much more friendly to developers because that is partially how Linux survives. Linux survives by users submitting code as no one company owns Linux. Linux has much less bloatware (which greatly slows the performance of compilers). Like I said though, Linux is specifically designed for this type of thing, where Windows is designed for the home user and unfortunately used by many pros. Also Windows and the Windows kernel are proprietary making some programmers jobs much more difficult. Windows is great in many respects, but if you at all can, switch to Linux. There are a plethora of reasons to do so.

4 minutes ago, igormp said:

Mostly how Windows deals with IO and its filesystem

 

I agree Windows handles many things so much slower.

 

 

 

R U L E  # 1   A b o u t   M e:   I   u s u a l l y   g i v e   D U M B   a d v i c e   a n d   y o u   s h o u l d   n o t   l i s t e n   t o  m e.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Well I still do like windows and I want to continue using it. But which option do you think is better.

 

A> Dual boot Linux and Windows. 

B> Use WSL on windows.

 

By the way I will upgrade my laptop's memory and and buy new SSD. So I thought maybe I should install Linux on the new SSD which is 250gb and have windows on the NVMe SSD which is 128gb. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Alex MR46 said:

Javascript

Javascript is an interpreted language so compile times don't really play a role... perhaps your brother meant something else?

 

It's an odd general claim to make because, even with compiled languages, the speed varies greatly and may or may not be better than on Windows for a variety of reasons. For a lot of languages there are also more than one compilers that may or may not be faster than each other at some things and not others. For instance GCC on Linux is often much faster than VC++ (here are some possible reasons for that) but they're drastically different compilers and it's very hard to make a direct comparison.

 

With that said, speed aside there are a lot of benefits for a developer in switching to Linux such as great out of the box package and dependency management, a good shell and more.

54 minutes ago, Alex MR46 said:

Well I still do like windows and I want to continue using it. But which option do you think is better.

 

A> Dual boot Linux and Windows. 

B> Use WSL on windows.

B is definitely easier and more convenient to set up, if you want to become familiar with Linux however I do recommend installing it and using it for a bit. WSL will also inevitably suffer from any Windows issues that come from using NTFS and other such things that are not "Linux-native".

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Alex MR46 said:

Well I still do like windows and I want to continue using it. But which option do you think is better.

 

A> Dual boot Linux and Windows. 

B> Use WSL on windows.

 

By the way I will upgrade my laptop's memory and and buy new SSD. So I thought maybe I should install Linux on the new SSD which is 250gb and have windows on the NVMe SSD which is 128gb. 

I don't really like windows, so I'm really biased towards A.

 

10 minutes ago, Sauron said:

Javascript is an interpreted language so compile times don't really play a role... perhaps your brother meant something else?

Probably meant build times, which are AWFUL in the js world.

11 minutes ago, Sauron said:

WSL will also inevitably suffer from any Windows issues that come from using NTFS and other such things that are not "Linux-native".

WSL2 lives pretty much in its own VM. The problem is that it'll live inside the disk windows is currently using, so bandwidth may be a problem.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, igormp said:

WSL2 lives pretty much in its own VM. The problem is that it'll live inside the disk windows is currently using, so bandwidth may be a problem.

Most of the work is going to happen on files you have on your windows partition if you use WSL, I'm not even sure if it has its own ext4 virtual partition or if it's just emulated.

 

-edit-

in fact I just checked and it seems to just share the C partition

image.png.ca921f6cc469b22b8f55633ef6ae038c.png

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Sauron said:

Most of the work is going to happen on files you have on your windows partition if you use WSL

Only if you want to keep your files on the Windows side.

11 minutes ago, Sauron said:

I'm not even sure if it has its own ext4 virtual partition or if it's just emulated.

It does, it's a full blown VM.

12 minutes ago, Sauron said:

in fact I just checked and it seems to just share the C partition

Under a mount point.

 

I recommend this article on some benchmarks agaisnt native vs wsl vs wsl2, wsl2 is way closer to native than wsl1, as I mentioned before:

https://www.phoronix.com/scan.php?page=article&item=wsl2-ryzen9-5900x&num=1

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, igormp said:

It does, it's a full blown VM.

Interesting... I wonder why df just reports the same exact storage stats in the "root" filesystem and the C drive mountpoint. Maybe WSL isn't to be trusted with drive info... at least relating to its own root.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, Sakuriru said:

I'm confused because you don't compile javascript.

What I meant was build times. Sorry for the confusion 😄. Like I said, I am a beginner. 

 

https://levelup.gitconnected.com/working-with-front-end-tools-on-linux-and-windows-the-grand-performance-test-b51a77a71636

 

I found this article that shows some benchmarks. He compares two different package managers npm and yarn, and also shows differences in build times between Windows and Ubuntu. Turns out they aren't really different when it comes to build times. But there is noticeable difference between the package managers. Check it out! 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×