On Tue, 31 Aug 2010, Levente Uzonyi wrote:
On Mon, 30 Aug 2010, Henrik Johansen wrote:
snip
"MediumDoc is a pure ascii ByteString of size 4096" [1 to: 100000 do: [:ix |MediumDoc squeakToUtf8]] timeToRun 362 384 [1 to: 100000 do: [:ix | MediumDoc convertToEncoding: 'utf-8']] timeToRun 437 564
And another with "SmallDoc": smallDoc := ByteString new: 20 streamContents: [ :stream | 20 timesRepeat: [ stream nextPut: (Character value: 128 atRandom - 1) ] ]. (1 to: 5) collect: [ :run | [ 1 to: 100000 do: [ :ix | smallDoc squeakToUtf8 ] ] timeToRun ]. "===> #(15 15 15 15 15)" (1 to: 5) collect: [ :run | [ 1 to: 100000 do: [ :ix | smallDoc convertToWithConverter: UTF8TextConverter new ] ] timeToRun ]. "===> #(34 34 34 35 32)" (1 to: 5) collect: [ :run | [ 1 to: 100000 do: [ :ix | smallDoc convertToEncoding: 'utf-8' ] ] timeToRun ]. "===> #(1256 1258 1259 1260 1260)" smallDoc := ByteString new: 20 streamContents: [ :stream | 20 timesRepeat: [ stream nextPut: (Character value: 128 atRandom - 1) ] ]. smallDoc at: 10 put: (Character value: 129). (1 to: 5) collect: [ :run | [ 1 to: 100000 do: [ :ix | smallDoc squeakToUtf8 ] ] timeToRun ]. "===> #(115 112 112 113 112)" (1 to: 5) collect: [ :run | [ 1 to: 100000 do: [ :ix | smallDoc convertToWithConverter: UTF8TextConverter new ] ] timeToRun ]. "===> #(157 125 124 126 125)" (1 to: 5) collect: [ :run | [ 1 to: 100000 do: [ :ix | smallDoc convertToEncoding: 'utf-8' ] ] timeToRun ]. "===> #(1416 1419 1419 1429 1428)" Levente