Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I work on Linux and a friend on a Windows 7.

I was amazed about the speed that NetBeans, Eclipse, pgAdmin and other programs open a lot, really, a LOT faster on Linux than on windows.

What is the main difference between Linux and windows kernel that causes that time load difference?

Both machines have exactly the same hardware configuration.

share|improve this question

closed as not constructive by Thomas W., fossfreedom Jun 15 '12 at 11:37

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Funny, my experience is exactly the opposite - on all of my PCs, programs in Windows tend to load a lot faster than on Linux (especially under Windows 7, which guesses which programs you will open based on past usage, and preloads them into memory). Perhaps his Windows machine is full of bloatware? Is the company anti-virus Windows-only? Have you tried running Linux on the same machine (failing hard-drives affect load times drastically). –  BlueRaja - Danny Pflughoeft Jun 14 '12 at 21:53
    
@BlueRaja-DannyPflughoeft thanks for your comment. As I told on the question, both machines have the same hardware configuration, both came with windows 7 but I'm a Linux user and no, his windows is not bloated –  Gerep Jun 15 '12 at 11:40
add comment

4 Answers 4

up vote 8 down vote accepted

This is just my guess, but I think that when you work for a company, where once everything is compiled (converted to binary data, which computers can execute), nobody can see the source code anymore, you tend to be a lot lazier, as it doesn't matter as long as it works.
Linux is open source, so everyone can see the source code if they would wish to do so. If you are lazy, and write a really crappy piece of code which will really slow down the system or something of the sorts, there goes your reputation, as everyone just saw. Developers and users alike. I think that's one of the reasons why open souyce developers tend to be less lazy.

It's also a fact that the core of the Windows kernel was never written with the intention of becoming what it is today (neither was Linux', but they did the effort to optimize the old bits), and developers have simply always been adding and adding on top of it, until the code was so cryptic that nobody could make something out of it anymore. Two properties of messy code is that there's often a lot of redundancy, and that you don't see the links between two pieces of code so easily anymore, which makes that you can't even try to start optimizing it. Just an example (not a cryptic one);

for (int i = 0; i < 20; i++)
{
    if (x == y)
    {
        if (z <= u)
        {
            goto banana;
        }
    }
}

The example above could be done much more efficiently;

for (int i = 0; (i < 20) && (x == y) && (z <= u); i++)
{
    banana ();
}
share|improve this answer
1  
I believe in the programmers area, the current consensus is that lazy and/or sloppy coding is well optimized in the compilers. However, compilers can't help bloat and legacy, which might be there -- and related to your intent. –  Chris K Jun 14 '12 at 20:00
    
+1 for the example –  Gerep Jun 14 '12 at 20:28
3  
Both of those code examples will almost certainly compile to the same thing (minus the function-call vs. goto)... –  BlueRaja - Danny Pflughoeft Jun 14 '12 at 21:54
    
@BlueRaja-DannyPflughoeft I know, but I needed a simple example to explain it. –  RobinJ Jun 15 '12 at 9:14
add comment

This is just my opinion but i think there are various reasons for GNU/Linux systems being faster than Windows and not all are related to kernel:

  • Obviously there is the reason explained by RobinJ, it's quite obvious that if software is open source the code tends to be more efficiently-written
  • Linux makes use of very optimized components for example it uses a very optimized scheduler that tends to maximize CPU utilization.
  • Linux systems suffer less from memory fragmentation
  • Linux systems have a better use of the main memory and usually tend to massively use cache, Windows systems instead tend to massively use virtual memory
  • Linux kernel is continuosly updated and useless parts are usually removed, although Linus Torvalds said that Linux kernel is becoming "huge and bloated", in opposition updates to the NT kernel are usually built on top of the existing ones.
share|improve this answer
add comment

Another big one not mentioned yet is that Linux has better filesystems. NTFS's performance with small files isn't that great -- ext3 is better, and ext4 is much, much better. There's some interesting speculation on why in another question.

When you're opening a program, a significant amount of the startup time is loading a bunch of tiny files from the disk, so having a filesystem that does that quickly is very important.

share|improve this answer
add comment

I believe the kernel alone isn't the answer. Windows 7 is the first time Windows was responsive enough that I consider it to be acceptable.

I believe more of the speed differential is related to @RobinJ's thoughts on software engineering. Everything* in Windows is built on the MSDN via some kind of Microsoft framework or another. This is actually related to how Big Business loves Microsoft; Microsoft is all about helping different programs/suites/technologies talk to each other.

Next... to make it easier for the developers to have the essentials covered (and not reinvent the wheel) Microsoft allows makers to bundle and/or require precompiled libraries like Microsoft Visual C++ 2008 Redistributable. Or .Net4.0, MSSQL 2005, ad nauseum. There are something like ten years worth of packages developers can use and build upon and require end users to install on their Windows computers in order to use the new software.

So in order for program Zyzzyx to load and run, one or more MSDN redistributable libraries have to be present and running. These libraries determine how programs interact with the OS.

To boil it down, I would opine that Window's intentional compatibility across decades of software makes it bloated and occasionally more slow than a comparable linux system. Also note that I have developed visual software for windows but not any for linux... not GTK, Qt, Py, anything, so my assumptions about linux being less bloated are just that.

edited to add: further, FOSS software does have people improving it all the time, so GTK will improve as time passes rather than GTK-2005 and GTK-2008 being on same computer, while Microsoft does that all the time.

*- ok there are exceptions, I'm sure.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.