[squeak-dev] Read buffering for FileStream

Levente Uzonyi leves at elte.hu
Sun Dec 6 07:47:03 UTC 2009


Hi,

I uploaded two packages to The Inbox Multilingual-ul.70 and Files-ul.47 
(load them in this order) which add read buffering to FileStream's 
subinstances. As usual, all tests are green (which were green before). I 
made some benchmarks on my notebook (core2 duo 2.4GHz, windows vista, 
3.11.4 vm) with the current trunk image:

(1 to: 3) collect: [ :each |
 	[
 		StandardFileStream
 			readOnlyFileNamed: (SourceFiles at: 1) name
 			do: [ :file |
 				[ file next == nil ] whileFalse ] ] timeToRun ]

Old: #(80165 79901 79762)
New: #(2247 1770 1802)
Speedup: ~41.21


(1 to: 3) collect: [ :each |
 	[
 		MultiByteFileStream
 			readOnlyFileNamed: (SourceFiles at: 1) name
 			do: [ :file |
 				[ file next == nil ] whileFalse ] ] timeToRun ]
Old: #(76133 76243 76287)
New: #(5751 5741 5752)
Speedup: ~13.26


(1 to: 3) collect: [ :each |
 	[
 		MultiByteFileStream
 			readOnlyFileNamed: (SourceFiles at: 1) name
 			do: [ :file |
 				file
 					ascii;
 					wantsLineEndConversion: false;
 					converter: UTF8TextConverter new.
 				1 to: 10000 do: [ :i | file upTo: Character cr ] ] ] timeToRun ]
Old: #(1940 1907 1902)
New: #(297 293 292)
Speedup: ~6.52x


[
 	CompiledMethod allInstancesDo: [ :each |
 		each
 			getSourceFromFile;
 			timeStamp ] ] timeToRun
Old: 102988
New: 29290
Speedup: ~3.52x


Running all tests profiled with the Test Runner:
Old: 638341
New: 552340
Speedup: ~1.16x


Should we add this to the trunk until something better (than FileStream) 
is available?

Cheers,
Levente



More information about the Squeak-dev mailing list