# reiser4 slower than reiser3 [SOLVED]

## Ypsilon

I decided to try reiser4 on one of my emtpy partitions, just to see how fast it is compared to the "normal" reiser that I have been using for years.

So i patched a vanilla 2.6.4 kernel with the latest reiser4 patch from www.namesys.com, emerged reiser4progs and created a shiny new reiser4 file system on this empty partition.

Then I rebootet from my 2.6.6-love1 kernel into the 2.6.4-reiser4 kernel and prepared everything to probe the speed of reiser4.

I have an Athlon64 3200+ machine with 1 Gig of RAM and a 160GB Samsung S-ATA HDD which does about 59MB/s in the hdparm benchmark.

The whole system and kernel is 64bit and compiled with gcc 3.4.

I created a folder "reiser4" on the reiser4 partition and a folder "reiser3" on my reiser3.6 root partition. 

In these directories I copied the sources of the last 4 kernel versions and bunzip2ed them.

So I had 4 uncompressed tarballs laying around, each about 190MB in size.

Then I made a little script that looks like this:

```

#!/bin/bash

sync

tar -xf linux-2.6.3.tar

sync

tar -xf linux-2.6.4.tar

sync

tar -xf linux-2.6.5.tar

sync

tar -xf linux-2.6.6.tar

sync

cp -r linux-2.6.3 linux-2.6.3.2

sync

cp -r linux-2.6.4 linux-2.6.4.2

sync

cp -r linux-2.6.5 linux-2.6.5.2

sync

cp -r linux-2.6.6 linux-2.6.6.2

sync

rm -r linux-2.6.3 linux-2.6.3.2 linux-2.6.4 linux-2.6.4.2 linux-2.6.5 linux-2.6.5.2 linux-2.6.6 linux-2.6.6.2

sync

```

So it untars everything, copies it once and then deletes it all.

Between the different steps I put the "sync" command to empty the HDD cache.

After that, I killed absolutely every process that could disturb my HDD while running the test, e.g. all the logging deamons.

So there was nothing left that could break the test results in any way.

Now, look at what I did. That was with reiser3.6:

```

gentoo reiser3 # ls -la

total 761248

drwxr-xr-x   2 root  root        240 May 12 15:21 .

drwxr-xr-x  21 benni users      3152 May 12 15:12 ..

-rw-r--r--   1 root  root  192737280 May 12 15:12 linux-2.6.3.tar

-rw-r--r--   1 root  root  194017280 May 12 15:12 linux-2.6.4.tar

-rw-r--r--   1 root  root  195348480 May 12 15:12 linux-2.6.5.tar

-rw-r--r--   1 root  root  197396480 May 12 15:12 linux-2.6.6.tar

-rw-r--r--   1 root  root       2057 May 12 15:12 log.reiser4

-rwxr-xr-x   1 root  root        396 May 12 15:12 speed_test

gentoo reiser3 # ps ax

  PID TTY      STAT   TIME COMMAND

    1 ?        S      0:04 init [3]

    2 ?        SN     0:00 [ksoftirqd/0]

    3 ?        S<     0:00 [events/0]

    4 ?        S<     0:02 [kblockd/0]

    8 ?        S<     0:00 [aio/0]

    7 ?        S      0:05 [kswapd0]

    9 ?        S      0:00 [scsi_eh_0]

   11 ?        S      0:00 [scsi_eh_1]

   13 ?        S      0:00 [kseriod]

   14 ?        S<     0:00 [reiserfs/0]

  122 ?        Ss     0:00 /sbin/devfsd /dev

 4497 ?        S      0:00 [khubd]

 5435 ?        Ss     0:00 login -- root

 5436 tty3     Ss+    0:00 /sbin/agetty 38400 tty3 linux

 5437 tty4     Ss+    0:00 /sbin/agetty 38400 tty4 linux

 5438 tty5     Ss+    0:00 /sbin/agetty 38400 tty5 linux

 5439 tty6     Ss+    0:00 /sbin/agetty 38400 tty6 linux

 5446 ?        Ss     0:00 login -- root

 5447 tty1     Ss     0:01 -bash

 5539 ?        S      0:00 [ktxnmgrd:hde2:w]

 5540 ?        S      0:00 [ent:hde2.]

 5792 tty2     Ss+    0:00 -bash

 5810 ?        S<     0:01 [pdflush]

 5835 ?        S<     0:00 [pdflush]

 5844 ?        Ss     0:00 gpm -m /dev/mouse -t imps2

 5880 tty1     R+     0:00 ps ax

gentoo reiser3 # cat ./speed_test

#!/bin/bash

sync

tar -xf linux-2.6.3.tar

sync

tar -xf linux-2.6.4.tar

sync

tar -xf linux-2.6.5.tar

sync

tar -xf linux-2.6.6.tar

sync

cp -r linux-2.6.3 linux-2.6.3.2

sync

cp -r linux-2.6.4 linux-2.6.4.2

sync

cp -r linux-2.6.5 linux-2.6.5.2

sync

cp -r linux-2.6.6 linux-2.6.6.2

sync

rm -r linux-2.6.3 linux-2.6.3.2 linux-2.6.4 linux-2.6.4.2 linux-2.6.5 linux-2.6.5.2 linux-2.6.6 linux-2.6.6.2

sync

gentoo reiser3 # time ./speed_test

real    2m13.038s

user    0m0.724s

sys     0m20.752s

gentoo reiser3 #

```

And these are the results for reiser4:

```

gentoo reiser4 # ls -la

total 761238

drwxr-xr-x   3 root root         7 May 12 15:04 .

drwxr-xr-x  10 root root       272 May 12 14:32 ..

-rw-r--r--   1 root root 192737280 May 12 14:58 linux-2.6.3.tar

-rw-r--r--   1 root root 194017280 May 12 14:58 linux-2.6.4.tar

-rw-r--r--   1 root root 195348480 May 12 14:58 linux-2.6.5.tar

-rw-r--r--   1 root root 197396480 May 12 14:47 linux-2.6.6.tar

-rwxr-xr-x   1 root root       396 May 12 15:06 speed_test

gentoo reiser4 # ps ax

  PID TTY      STAT   TIME COMMAND

    1 ?        S      0:04 init [3]

    2 ?        SN     0:00 [ksoftirqd/0]

    3 ?        S<     0:00 [events/0]

    4 ?        S<     0:00 [kblockd/0]

    8 ?        S<     0:00 [aio/0]

    7 ?        S      0:01 [kswapd0]

    9 ?        S      0:00 [scsi_eh_0]

   11 ?        S      0:00 [scsi_eh_1]

   13 ?        S      0:00 [kseriod]

   14 ?        S<     0:00 [reiserfs/0]

  122 ?        Ss     0:00 /sbin/devfsd /dev

 4497 ?        S      0:00 [khubd]

 5435 tty2     Ss+    0:00 /sbin/agetty 38400 tty2 linux

 5436 tty3     Ss+    0:00 /sbin/agetty 38400 tty3 linux

 5437 tty4     Ss+    0:00 /sbin/agetty 38400 tty4 linux

 5438 tty5     Ss+    0:00 /sbin/agetty 38400 tty5 linux

 5439 tty6     Ss+    0:00 /sbin/agetty 38400 tty6 linux

 5446 ?        Ss     0:00 login -- root

 5447 tty1     Ss     0:01 -bash

 5539 ?        S      0:00 [ktxnmgrd:hde2:w]

 5540 ?        S      0:00 [ent:hde2.]

 5744 ?        S<     0:00 [pdflush]

 5750 ?        S<     0:01 [pdflush]

 5764 tty1     R+     0:00 ps ax

gentoo reiser4 # cat ./speed_test

#!/bin/bash

sync

tar -xf linux-2.6.3.tar

sync

tar -xf linux-2.6.4.tar

sync

tar -xf linux-2.6.5.tar

sync

tar -xf linux-2.6.6.tar

sync

cp -r linux-2.6.3 linux-2.6.3.2

sync

cp -r linux-2.6.4 linux-2.6.4.2

sync

cp -r linux-2.6.5 linux-2.6.5.2

sync

cp -r linux-2.6.6 linux-2.6.6.2

sync

rm -r linux-2.6.3 linux-2.6.3.2 linux-2.6.4 linux-2.6.4.2 linux-2.6.5

linux-2.6.5.2 linux-2.6.6 linux-2.6.6.2

sync

gentoo reiser4 # time ./speed_test

real    2m54.530s

user    0m0.756s

sys     0m29.925s

gentoo reiser4 #

```

As you can see, the test took over 40 seconds LONGER with reiser4 than it did with reiser3.6.

Of course I retried it. The results stayed the same...

Now that's kinda weird, isn't it?

reiser4 is slower than reiser3 on my system.

Does anyone know what I have done wrong?

I thought it would be like a speed boost of 50% or more with reiser4 compared to the normal reiser.

I read this in some threads in this forum...

I'm desperate.   :Sad: 

----------

## xr31Daisy

AFAIK, your harddrive's speed is dependant on where the data is on the disk. That means the transfer rate won't be the same depending on which partition you're using. LostCircuits has a series of articles on hard-drives, if you're interested.

To make your test more reliable, I think you should use the same partition for both reiser4 and reiser3 ( reformating the partition to switch from a format to another ),

----------

## Ypsilon

Thank you, I'm going to check it with the same partition.

----------

## Ypsilon

Well... now i reran the test for reiser4 and reiser3 on the same partition.

It looks different now:

```

reiser3.6:

time ./speed_test

real    3m11.969s

user    0m0.767s

sys     0m24.631s

reiser4:

time ./speed_test

real    2m51.217s

user    0m0.691s

sys     0m26.807s

```

So reiser4 was about 11% faster than reiser3.

I also did 4 other tests this time:

- speed_test_cp_large_files

- speed_test_rm_large_files

- speed_test_cp_small_files

- speed_test_rm_small_files

The first test copies a 200MB kernel-src-tar twenty times, the second test deletes the 20 copies.

The thirt test copies the extracted 200MB kernel-src-dir ten times and the fourth test deletes these directories.

This way I wanted to find out how reiser4 behaves in copying large files, many small files, and deleting large and small files.

These are the results:

For reiser3.6:

```

time ./speed_test_cp_large_files

real    1m38.078s

user    0m0.027s

sys     0m13.504s

time ./speed_test_rm_large_files

real    0m3.902s

user    0m0.006s

sys     0m1.280s

time ./speed_test_cp_small_files

real    2m20.780s

user    0m0.471s

sys     0m20.908s

time ./speed_test_rm_small_files

real    0m28.032s

user    0m0.136s

sys     0m8.914s

```

For reiser4:

```

time ./speed_test_cp_large_files

real    1m43.041s

user    0m0.041s

sys     0m16.376s

time ./speed_test_rm_large_files

real    0m0.681s

user    0m0.007s

sys     0m0.613s

time ./speed_test_cp_small_files

real    2m4.265s

user    0m0.505s

sys     0m21.562s

time ./speed_test_rm_small_files

real    1m20.573s

user    0m0.137s

sys     0m14.057s

```

After the first test with 11% improvement I was getting new hope, but the other results aren't really great for reiser4.

In copying large files, reiser4 was 5% slower than reiser3.6.

In deleting large files, reiser4 was 83% faster than reiser3.6 (well, that's an improvement, but who cares much about the performance of deleting large files?)

In copying small files, reiser4 was 12% faster than reiser3.6 (that's good at least)

In deleting small files, reiser4 was 187% slower than reiser3.6 (uuuh..)

This still looks weak.

Strange thing...

But nevertheless, reiser4 seems to have a little better performance than reiser4 as my first test showed.

Maybe I will write a longer script with much more copying/extracting/whatever tasks to get more realistic results.

However, the above results quite disappointed me. I was awaiting more from reiser4.

----------

## verbatim

Ypsilon: just a note here that I'm wondering about.  It seems to me that forcing all of those "sync" commands is going to pretty much invalidate the benchmark.  From what I have heard (could be way off), reiser4 takes longer to sync than reiserfs, but does so less often.  Now if you force it to do so more often, it won't be nearly as effective in deciding for itself when the ideal time is to write.  Given that, do you think this is a realistic/valid benchmark?  (Especially considering that in real usage, nobody is going to be running "sync" all the time.)

Just a thought.

----------

## AlterEgo

Another thought: tar is using quite a bit of CPU cycles.

Reiser also likes CPU cycles.

Isn't that possibly impairing your benchmark?

----------

## Ypsilon

Hmmm... I could put out all the syncs and just do a single sync before the test - just to make sure that there are always the same conditions in all tests - end then let the filesystem "decide" when it wants to sync again.

The problem was just that when I do something like this:

cp linux-2.6.6.tar .

tar -xf linux-2.6.6.tar

it goes VERY fast since the file is still cached in the RAM when I untar it and therefore won't be read from the HDD.

I wanted to prevent this by doing sync after every command.

But now it seems silly to my too as there are used differend files in the tests and one sync should be enough before the tests.

I'm going to recheck that.

Thank you for your support!

----------

## Ypsilon

Ok... i wrote a new script that looks like this:

```

#!/bin/bash

cd $1;

sync

tar -xf linux-2.6.3.tar

tar -xf linux-2.6.4.tar

cp -r linux-2.6.3 linux-2.6.3.1

cp -r linux-2.6.4 linux-2.6.4.1

cp -r linux-2.6.3.1 linux-2.6.3.2

cp -r linux-2.6.4.1 linux-2.6.4.2

cp -r linux-2.6.3.2 linux-2.6.3.3

cp -r linux-2.6.4.2 linux-2.6.4.3

cp -r linux-2.6.3.3 linux-2.6.3.4

cp -r linux-2.6.4.3 linux-2.6.4.4

mkdir tmp1

mv *.tar tmp1/

mkdir tmp2

mv linux-* tmp2/

tar -cf big1.tar tmp1/

tar -cf big2.tar tmp2/

cp big1.tar big1.1.tar 

cp big2.tar big2.2.tar

split -a 2 -b 50000000 big1.tar

split -a 5 -b 1000000 big2.tar

sync

```

So it does a lot of heavy copy/read/write tasks.

The results are, on reiser3.6:

```

real    11m0.375s

user    0m1.595s

sys     1m3.480s

```

And on reiser4:

```

real    8m31.508s

user    0m1.660s

sys     1m19.876s

```

So reiser4 was 22.5 percent faster than reiser3.6.

This seems like a nice result... waiting for reiser4 to be included in love-sources! 

 :Very Happy: 

----------

## yngwin

 *Ypsilon wrote:*   

> So reiser4 was 22.5 percent faster than reiser3.6.
> 
> This seems like a nice result... waiting for reiser4 to be included in love-sources! 
> 
> 

 

Well we need the namesys guys to port their stuff to the 2.6.6 kernel. In the meantime we can still use 2.6.5 with Reiser4. Look in my sig....    :Cool: 

----------

## cordor

Consider average users might run applications most of the time, and webservers serve files only. I guess benchmarking on allocating files in a large directory, or performing heavily threaded read-only/rw operation would be more convincing for me. IMHO  :Smile: 

----------

## Ex-Cyber

Why not wrap a parallelization script around the tests and see how well Reiser4 scales? I was under the impression that this was among its key advantages...

----------

## darksbane

 *yngwin wrote:*   

>  *Ypsilon wrote:*   So reiser4 was 22.5 percent faster than reiser3.6.
> 
> This seems like a nice result... waiting for reiser4 to be included in love-sources! 
> 
>  :D 
> ...

 

2.6.6-love4 includes reiser4 support. :)

steel posted about it in the love3 thread, there's been no official new thread since then. but it's been rocking like ninja for me.

----------

