Why is there a speed difference when opening/reading files first time and after that?
Here's an example.
Code:
$ time md5sum song.mp3
290abe89444add77b02815c55311e452 song.mp3
real 0m2.472s
user 0m0.940s
sys 0m0.360s
$ time md5sum song.mp3
290abe89444add77b02815c55311e452 song.mp3
real 0m0.065s
user 0m0.030s
sys 0m0.030s
Differences are larger with big files:
Code:
$ time md5sum file.tar.bz2
3c6cfd9fcd180481063b4058cf6faff2 file.tar.bz2
real 0m7.072s
user 0m1.230s
sys 0m0.960s
$ time md5sum file.tar.bz2
3c6cfd9fcd180481063b4058cf6faff2 file.tar.bz2
real 0m0.165s
user 0m0.110s
sys 0m0.040s
I thought it was Journal on ext3 file system, but same happens on ext2 systems too.
I think that on my previous system (RedHat 8.0, 2.4.20) this didn't happen.
Linux 2.4.26, ext3, HDD Seagate ST340014A.
Thanks in advance.