On Saturday 04 September 2004 15:07, Jan Hlavat� wrote:
> I've ran the test on my crappy Linux based Celeron 800 firewall machine.
> It has RedHat linux 9.0 on single old IDE disk formatted with ext3
> filesystem.
> I'd really like to see what numbers I'd get with different filesystems,
> like reiser4 - ext3 has a reputation of being a bit slow...
My Linux box is a PIII 667, with a single 80GB IDE disk formatted with
reiser3. It runs Gentoo Linux 1.4.
I've attached the results...
It seems that with a preallocated file all the methods have the same (good)
performance.
Cheers,
--
Davide Savazzi
---------------------------------------------
1. System info:
---------------------------------------------
OS Platform: Linux/i386/2.6.7
Java spec: Java Platform API Specification version 1.5 from Sun Microsystems
Inc.
Java VM: Java HotSpot(TM) Client VM version 1.5.0-rc-b63 from Sun
Microsystems Inc.
Java home: /opt/sun-jdk-1.5.0_rc1/jre
Test file: /home/davide/tmp/testRw/test.bin
---------------------------------------------------------------------
2. Testing growing file using RandomAccessFile "rw" + .getFD().sync()
---------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 30397 ms
Writes per second: 328.98 writes/s
Time per chunk: 3.04 ms
Write bandwidth: 1.0MB/s
---------------------------------------------------------------------------
3. Testing preallocated file using RandomAccessFile "rw" + .getFD().sync()
---------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3949 ms
Writes per second: 2532.287 writes/s
Time per chunk: 0.395 ms
Write bandwidth: 10.0MB/s
---------------------------------------------------------------------
4. Testing growing file using RandomAccessFile "rws"
---------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 4297 ms
Writes per second: 2327.205 writes/s
Time per chunk: 0.43 ms
Write bandwidth: 9.0MB/s
---------------------------------------------------------------------
5. Testing preallocated file using RandomAccessFile "rws"
---------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3930 ms
Writes per second: 2544.529 writes/s
Time per chunk: 0.393 ms
Write bandwidth: 10.0MB/s
---------------------------------------------------------------------
6. Testing growing file using RandomAccessFile "rwd"
---------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 4302 ms
Writes per second: 2324.5 writes/s
Time per chunk: 0.43 ms
Write bandwidth: 9.0MB/s
---------------------------------------------------------------------
7. Testing preallocated file using RandomAccessFile "rwd"
---------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3927 ms
Writes per second: 2546.473 writes/s
Time per chunk: 0.393 ms
Write bandwidth: 10.0MB/s
------------------------------------------------------------------------------
8. Testing growing file using direct buffer + FileChannel "rw" + force(true)
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 30077 ms
Writes per second: 332.48 writes/s
Time per chunk: 3.008 ms
Write bandwidth: 1.0MB/s
-----------------------------------------------------------------------------------
9. Testing preallocated file using direct buffer + FileChannel "rw" +
force(true)
-----------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3986 ms
Writes per second: 2508.781 writes/s
Time per chunk: 0.399 ms
Write bandwidth: 10.0MB/s
------------------------------------------------------------------------------
10. Testing growing file using direct buffer + FileChannel "rw" + force(false)
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 30009 ms
Writes per second: 333.233 writes/s
Time per chunk: 3.001 ms
Write bandwidth: 1.0MB/s
------------------------------------------------------------------------------
11. Testing preallocated file using direct buffer + FileChannel "rw" +
force(false)
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3989 ms
Writes per second: 2506.894 writes/s
Time per chunk: 0.399 ms
Write bandwidth: 10.0MB/s
------------------------------------------------------------------------------
12. Testing growing file using direct buffer + FileChannel "rws"
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 4307 ms
Writes per second: 2321.802 writes/s
Time per chunk: 0.431 ms
Write bandwidth: 9.0MB/s
------------------------------------------------------------------------------
13. Testing preallocated file using direct buffer + FileChannel "rws"
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3929 ms
Writes per second: 2545.177 writes/s
Time per chunk: 0.393 ms
Write bandwidth: 10.0MB/s
------------------------------------------------------------------------------
14. Testing growing file using direct buffer + FileChannel "rwd"
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 4260 ms
Writes per second: 2347.418 writes/s
Time per chunk: 0.426 ms
Write bandwidth: 9.0MB/s
------------------------------------------------------------------------------
15. Testing preallocated file using direct buffer + FileChannel "rwd"
------------------------------------------------------------------------------
Chunk size: 4228 bytes
Count: 10000
Total time: 3891 ms
Writes per second: 2570.033 writes/s
Time per chunk: 0.389 ms
Write bandwidth: 10.0MB/s