Most active commenters
  • shin_lao(6)
  • omellet(5)

←back to thread

Why is Windows so slow?

(games.greggman.com)
337 points kristianp | 16 comments | | HN request time: 0.936s | source | bottom
1. shin_lao ◴[] No.3369174[source]
NTFS is a slower file system, that's probably the main reason why. Also console I/O is much better on Linux than Windows.

Our software builds everyday on FreeBSD, Linux and Windows on servers that are identical.

The windows build takes 14 minutes. The FreeBSD and Linux build take 10 minutes (they run at almost identical speed).

Check out is more than twice slower on Windows (we use git).

Debug build time is comparable 5 minutes for Windows, 4 minutes 35 on Linux.

Release build time is almost 7 minutes on Windows and half that on Linux.

VS compiles more slowly than gcc but overall it's a better compiler. It handles static variables better and is not super demanding about typenames like gcc is. Also gcc is extremely demanding in terms of memory. gcc is a 64-bit executable, Visual Studio is still a 32-bit execuable. We hope Microsoft will fix that in Visual Studio 2011.

Its easier to parallelize gmake than Visual Studio, which also explains the better Linux build time. Visual Studio has got some weird "double level" mulithreading which is eventually less efficient than just running the make steps in parallel as you go through your make file.

However our tests run at comparable speed on Linux and Windows and the Windows builds the archive ten times faster than Linux.

replies(2): >>3369184 #>>3369513 #
2. obtu ◴[] No.3369184[source]
What is this archive step you mention in passing, and what makes Linux slow at it?
replies(1): >>3369191 #
3. shin_lao ◴[] No.3369191[source]
I don't know why Linux is so slow at it, it's when we build the tgz containing all the binaries before uploading it to the distribution server.
replies(1): >>3369217 #
4. obtu ◴[] No.3369217{3}[source]
Possibly Linux isn't using the same compression settings?
replies(1): >>3369234 #
5. shin_lao ◴[] No.3369234{4}[source]
I think it's more a caching thing, it's as if Windows isn't rereading the files from disk.
6. omellet ◴[] No.3369513[source]
There's a 64-bit version of the MSVC toolchain and MSBuild, so if you build outside of Visual Studio you won't be so constrained. This is how we do our builds here at work (a mix of C# and C++). We still edit code in VS, but local builds and continuous integration are done entirely using MSBuild. As of VS2010, C++ project files are MSBuild projects, and no longer need to use VCBuild.exe.
replies(2): >>3369525 #>>3369704 #
7. shin_lao ◴[] No.3369525[source]
I didn't know about the 64-bit toolchain, where can you get it?
replies(2): >>3369680 #>>3371371 #
8. ◴[] No.3369680{3}[source]
9. CurtHagenlocher ◴[] No.3369704[source]
I don't think this is true, at least for the C++ compiler. There's a 32-bit version producing 32-bit code, a 32-bit version producing 64-bit code and a 64-bit version producing 64-bit code.

Disclaimer: I work at Microsoft, but this is my hazy recollection rather than some kind of informed statement.

replies(1): >>3371374 #
10. omellet ◴[] No.3371371{3}[source]
It's an optional install package when you install Visual Studio.
replies(1): >>3372845 #
11. omellet ◴[] No.3371374{3}[source]
The %VSROOT%\VC\bin\amd64 is indeed a native x64 binary.
replies(1): >>3371969 #
12. CurtHagenlocher ◴[] No.3371969{4}[source]
Yes, but it can only produce x64 code; it can't produce x86 code. Mind you, I'd love to be wrong about that...
replies(1): >>3373072 #
13. shin_lao ◴[] No.3372845{4}[source]
We have it installed, do you have any reference about how to use it from a build process?
replies(1): >>3373078 #
14. omellet ◴[] No.3373072{5}[source]
Sorry, I didn't read your entire comment. The 64-bit linker can produce 32-bit code with /MACHINE:X86.
15. omellet ◴[] No.3373078{5}[source]
If you run the Visual Studio x64 tools command prompt from the start menu, it will set up the environment to have the 64-bit toolchain in your path.
replies(1): >>3373414 #
16. shin_lao ◴[] No.3373414{6}[source]
Thanks, but we've been struggling with building using the amd64 chaintool from visual studio.