[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    cp and BUFSIZ vs. fs block size detection
From:       Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn () axis ! com>
Date:       2007-11-30 23:52:46
Message-ID: 0712010007290.14789 () somehost
[Download RAW message or body]

In my previous post I wrote:

,----
| I need to do some other optimization too.  I'll get back on that later
| in another post.  I tested that idea by increasing the BUFSIZ (see
| include/libbb.h) from default 4096 to 8192 using:
|
|   CFLAGS += -D"BUFSIZ=8192"
|
| in a wrapper Makefile...
`----

'cp' is using BUFSIZ (default 4096 bytes).  Copying the bb-executable
(360k) from tmpfs to a NOR flash jffs partition takes 8.94s.  For
comparison, copying the same file using 'dd bs=8192' takes 5.70s.  That is
>36% better performance.  The BUFSIZ=8192 experiment showed (after
rebuilding bb) that 'cp' performs as good as dd does.

Globally doubling BUFSIZ might not be the best way to increase 'cp'
performance.  But adjusting BUFSIZ 'cp' uses at run time (as gnu-cp does,
I'm told) may be better.

To achieve that one would find max block size of source and destination
fs, and use that to perform 'cp'.  It looks like 'mv' and 'cp' have that
raw copy part in common, so 'mv' would also benefit from it when moving
files between partitions.  Copying over nfs uses huge buffer sizes (like
65536 bytes).

What do you think?


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic