SCOUG-HELP Mailing List Archives
Return to [ 29 |
July |
2003 ]
<< Previous Message <<
>> Next Message >>
=====================================================
If you are responding to someone asking for help who
may not be a member of this list, be sure to use the
REPLY TO ALL feature of your email program.
=====================================================
In <3F269986.6EBA@peterskye.com>, on 07/29/03
at 08:57 AM, Peter Skye said:
>Yes, this was done on purpose. The code to write the records to an
>output file would be identical in both cases, hence including it in the
>benchmark would be irrelevant.
The code would be identical, but the system I/O (i.e. head movement,
caching etc.) would be very different. It would only help the buffered
method.
>I can run the benchmark with additional file sizes and record sizes if
>you want more data.
Here's a version with cache flushing included:
iFileSize = 1000000
do while iFileSize <= 16000000
iRecSize = 10
do while iRecSize <= 100000
/* Flush cache */
x = charin( FillFile, , FillSize )
call stream FillFile, 'C', 'CLOSE'
x = ''
call stream TestFile, 'C', 'OPEN READ'
call Time( "R" )
do Index = 1 to iFileSize by iRecSize
x = charin( TestFile, , iRecSize )
end
ElapsedTimeByRecord = Time( "E" )
call stream TestFile, 'C', 'CLOSE'
/* Flush cache */
x = charin( FillFile, , FillSize )
call stream FillFile, 'C', 'CLOSE'
x = ''
/* Benchmark using CharIn() to read the entire file into a buffer.
*/
call stream TestFile, 'C', 'OPEN READ'
call Time( "R" )
buffer = charin( TestFile, , iFileSize )
do Index = 1 to iFileSize by iRecSize
x = substr( buffer, Index, iRecSize )
end
ElapsedTimeByBuffer = Time( "E" )
call stream TestFile, 'C', 'CLOSE'
say right(' ' iFileSize, 10),
right(' ' iRecSize, 12),
right(' ' ElapsedTimeByRecord, 18),
right(' 'ElapsedTimeByBuffer, 18)
iRecSize = iRecSize * 10
end /* iRecSize */
iFileSize = iFileSize * 2
end /* iFileSize */
And the results:
---- Seconds (uSec/Rec) to Read ---- Speed File
Size Record Size Individual Records Buffered Records Ratio ==========
=========== ================== ================ =====
1000000 10 10.620000 0.390000
1000000 100 1.090000 0.110000
1000000 1000 0.150000 0.080000
1000000 10000 0.050000 0.080000
1000000 100000 0.060000 0.080000
2000000 10 21.990000 1.330000
2000000 100 2.280000 0.250000
2000000 1000 0.300000 0.160000
2000000 10000 0.100000 0.140000
2000000 100000 0.090000 0.140000
4000000 10 44.410000 2.820000
4000000 100 4.880000 0.910000
4000000 1000 0.600000 0.300000
4000000 10000 0.200000 0.250000
4000000 100000 0.200000 0.260000
8000000 10 88.350000 5.420000
8000000 100 9.310000 1.010000
8000000 1000 1.200000 0.600000
8000000 10000 0.390000 0.560000
8000000 100000 0.380000 0.480000
16000000 10 175.920000 11.040000
16000000 100 18.420000 2.070000
16000000 1000 2.500000 1.170000
16000000 10000 0.790000 1.470000
16000000 100000 0.850000 1.000000
As expected, flushing the cache hurts the buffered version more than the
unbuffered version.
Steven
--
----------------------------------------------------------------------
"Steven Levine" MR2/ICE 2.37 #10183 Warp4/FP15/14.093c_W4
www.scoug.com irc.webbnet.info irc.fyrelizard.org #scoug (Wed 7pm PST)
----------------------------------------------------------------------
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-help".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 29 |
July |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|