emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: struct.el -- a package to encode/decode binary data


From: Stefan Monnier
Subject: Re: struct.el -- a package to encode/decode binary data
Date: Thu, 21 Mar 2002 11:58:34 -0500

> I just tried to measure whether there is any difference, by copying
> between two strings like this:
>   (let ((i (length a)))
>     (while (> i 0)
>       (setq i (1- i))
>       (aset a i (aref b i))))
> 
> a and b are either both multibyte or both unibyte and initialized
> to all NULs.  The difference in time is very small if there is any...

Try it with a initialized to all NULs and b initialized to all
eight-bit-graphic chars.

> > If the string holds non-ASCII text, yes.  But not in your case, where the 
> > ``string'' holds binary data, I think.

This is only true if binary values between 128 and 256 are represented
as a single-byte, but that's not the case in multibyte strings.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]