# Why is Ruby on Linux so much faster than on Windows?

**URL:** <https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718>\
**Category:** Rails\
**Created:** [March 31, 2007, 12:59pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718 "2007-03-31T12:59:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Joram](https://www.ruby-forum.com/u/Joram)\
**Post date:** [March 31, 2007, 12:59pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718/1 "2007-03-31T12:59:05Z")

</div>

Hi List,

I’m currently investigating some possibilities for deplyong my Rails  
app.  
I developed it on Windows XP, but I thought I should give linux a run  
too.  
I expected some performance benefit, but not of this level.

See the table for the measurments, all taken from the log by clicking  
5 times on the same method.

PC = old pc, Athlon xp 1800, 512 MB, 7200 rmp HD, Win XP  
Laptop-WinXP = Intel Centrino 1.5Ghz, 512MB, 4200 rmp HD, Win XP  
Laptop-Ubuntu = same laptop, but now with Ubuntu 7.04 Beta

All tests were run in development mode, with webrick 1.3.1, mysql  
configured just the same:

PC-WINXP LAPTOP-WINXP LAPTOP-UBUNTU  
(first test)  
0,27 0,5 0,12  
0,24 0,49 0,09  
0,95 0,26 0,09  
0,25 0,68 0,88  
1,14 0,28 0,2

(second test)  
0,72 0,43 0,29  
0,61 0,43 0,14  
1,28 0,25 0,25  
0,41 0,57 0,25  
0,83 0,3 0,13

Can anyone explain me why Rails or Ruby is that much faster on ubuntu?

---

<div class="post-metadata">

**Author:** ![Joram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Joram](https://www.ruby-forum.com/u/Joram)\
**Post date:** [March 31, 2007, 2:14pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718/2 "2007-03-31T14:14:12Z")

</div>

Some people claim that linux is faster than windows, i don’t have  
technical base to say that, maybe even those who claim that.

Also, linux doesn’t need graphical interface, and grafical interfaces  
consume CPU cycles too, Linus and UNIX where created to have simple  
design.

here is a text talking about Linux vs. Windows performance.  
[http://blogs.ittoolbox.com/linux/locutus/archives/why-linux-still-runs-faster-than-windows-14828](http://blogs.ittoolbox.com/linux/locutus/archives/why-linux-still-runs-faster-than-windows-14828)

you can find more with google

---

<div class="post-metadata">

**Author:** ![Joram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Joram](https://www.ruby-forum.com/u/Joram)\
**Post date:** [March 31, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718/3 "2007-03-31T19:25:26Z")

</div>

Ruby in general isn’t any noticeable slower on Windows than it is on  
Linux, but Windows in general is much slower in file operations, and so  
it is with Ruby. A Rails application uses many files, and hence the  
slowdown.

Roderick

---

<div class="post-metadata">

**Author:** ![Joram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Joram](https://www.ruby-forum.com/u/Joram)\
**Post date:** [March 31, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718/4 "2007-03-31T18:16:44Z")

</div>

Were they both fresh installs of the operating system? If not that  
could easily explain it. Because I WinXP primarily it has tons of  
‘junk’ on it. I try to keep my linux stuff as clean as possible  
(though I’m not very good at it because I’m still learning linux). I’m  
pretty sure that most linux distros are pretty lean after the initial  
installation, even Ubuntu. At least they are compared to Windows. I  
guess that could explain it too.

---

<div class="post-metadata">

**Author:** ![Joram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Joram](https://www.ruby-forum.com/u/Joram)\
**Post date:** [March 31, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718/5 "2007-03-31T22:55:12Z")

</div>

Phlip wrote:

> If I get a flash memory USB stick and mount it (WinXP _or_ Linux), will  
> it read and write files faster than those little spinning platters inside a  
> hard drive?

Usually, flash memory has lower read latency (which is good) but also  
lower throughput and higher read latency. Separate from these physical  
characteristics you also need to figure in the overhead from the USB  
port that usually is fairly CPU costly.

So it depends. Rails performs a lot of smallish reads but also does a  
fair amount of log writes.  
In all I’d still prefer the hard drive performance-wise, but I don’t  
have the numbers to back it up.

Roderick

---

<div class="post-metadata">

**Author:** ![Joram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Joram](https://www.ruby-forum.com/u/Joram)\
**Post date:** [March 31, 2007, 10:08pm UTC](https://www.ruby-forum.com/t/why-is-ruby-on-linux-so-much-faster-than-on-windows/90718/6 "2007-03-31T22:08:19Z")

</div>

Roderick van Domburg wrote:

> Ruby in general isn’t any noticeable slower on Windows than it is on  
> Linux, but Windows in general is much slower in file operations, and so  
> it is with Ruby. A Rails application uses many files, and hence the  
> slowdown.

Here’s a newb question that shows how well I keep with the times.

If I get a flash memory USB stick and mount it (WinXP _or_ Linux), will  
it  
read and write files faster than those little spinning platters inside a  
hard drive?

It seems there are those who put their entire project, Apache, Ruby,  
Rails,  
SVN and everything onto those things…

–  
Phlip  
["Pigleg too?", week 1](http://flea.sourceforge.net/PiglegToo_1.html)
