[Pharo-users] What is your preferred way for storing ByteArray's as text?

Bernardo Ezequiel Contreras vonbecmann at gmail.com
Thu Oct 29 16:07:42 EDT 2015


Esteban,
  Could you explain line 8 ? why did you use a Base64MimeConverter?
thanks.

line 8:

stream nextPutAll: 'ZnBase64Encoder '; nextPutAll: [ (Base64MimeConverter
mimeEncode: ba readStream multiLine: false) ] bench printString; cr.



On Thu, Oct 29, 2015 at 3:43 PM, Esteban A. Maringolo <emaringolo at gmail.com>
wrote:

> 2015-10-29 15:21 GMT-03:00 Peter Uhnák <i.uhnak at gmail.com>:
> >> >>> Option A) The printString of ByteArray, it is #[23 12 253 ...]
> >>
> >> >>> Option B) A Base64 encoded version of the ByteArray
> >
> >
> > I like this one, because it is not Pharo-specific format. ByteArray is
> not
> > pharo-specific, but the syntax is --- I can copy paste base64 from/to
> > outside world.
> > Plus base64 has better tool support in the wild.
>
> I also prefer base64 even over native binary storage.
>
> I ran a small comparison[1] of speed and size and these were my results.
>
> ByteArray size: 19448860
>
> Speed:
> Base64MimeConverter: ''0.592 per second''
> #hex: ''0.666 per second''
> #asString: ''6.898 per second''
> ZnBase64Encoder ''0.459 per second''
>
> Size:
> Base64MimeConverter: 26291980
> #hex: 38897720
> #asString: 19448860
> ZnBase64Encoder 25931816
>
> Esteban A. Maringolo
>
> [1]: http://ws.stfx.eu/47PV2GUP9ITS
>
>


-- 
Bernardo E.C.

Sent from a cheap desktop computer in South America.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20151029/ce51d6aa/attachment.html>


More information about the Pharo-users mailing list