[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 16 Apr 2009 09:22:19 +0100
Thunderbird 18.104.22.168 (Windows/20090302)
I am not sure if this is a bug, but would appreciate some advise.
If i use a single cp to copy multiple files, then read the files in
inode order. I see faster disk access times than if i copy each file
I am using inode order as i have already determined that this
drastically reduces the read times.
Does anyone know the difference between copying multiple files in one cp
command and copying the same files with multiple cp commands?
The set up is this:
A single disk freshly formatted with ext3 and mounted noatime,
nodiratime on /test
A set of test files, 13000 files avg 200KB, named numericaly 1 to 13000,
written in pseudo random order in one directory (A) kept on a separate
drive mounted on /data
# copy recursivly using cp
cp -a /data/A /test/
#copy all the files in A using cp
cp /data/A/* /test/B
#copy one file at a time in directory order
for f in `ls -U /data/A`; do cp /test/A/$f /test/C; done
#copy one file at a time in file name order
for f in `ls /data/A`; do cp /test/A/$f /test/D; done
#copy from D using a single cp command
cp /test/D/* /test/E
Now for each directory list files using ls -i, sort by inode number and
in a loop cat to /dev/null
/test/A takes 43s
/test/B takes 43s
/test/C takes 1m49s
/test/D takes 1m49s
/test/E takes 43s
I have run these tests in different orders and always get the same
results, even tried reformatting between each test.
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
- cp oddity,
Adrian Revill <=