[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: struct.el -- a package to encode/decode binary data
From: |
Kim F. Storm |
Subject: |
Re: struct.el -- a package to encode/decode binary data |
Date: |
21 Mar 2002 16:36:42 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 |
Eli Zaretskii <address@hidden> writes:
> On 21 Mar 2002, Kim F. Storm wrote:
>
> > > > Is there some specific reason not to use unibyte strings here?
> > >
> > > They are simply not needed here (AFAICS).
> >
> > On the surface, it looks "obvious" to use unibyte strings for
> > data which is known to be - and processed as - byte-oriented
> > data.
>
> That's the C programmer in you trying to get free ;-)
Right on the spot :-)
> > Am I right in assuming that aref, aset, and substring are potentially
> > much slower on a multibyte string than on a unibyte string?
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...
>
> If the string holds non-ASCII text, yes. But not in your case, where the
> ``string'' holds binary data, I think.
.. which confirms your belief.
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Re: struct.el -- a package to encode/decode binary data, (continued)
- Re: struct.el -- a package to encode/decode binary data, Eli Zaretskii, 2002/03/19
- Re: struct.el -- a package to encode/decode binary data, Luke Gorrie, 2002/03/19
- Re: struct.el -- a package to encode/decode binary data, Kim F. Storm, 2002/03/19
- Re: struct.el -- a package to encode/decode binary data, Thien-Thi Nguyen, 2002/03/19
- Re: struct.el -- a package to encode/decode binary data, Richard Stallman, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Eli Zaretskii, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Kim F. Storm, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Eli Zaretskii, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data,
Kim F. Storm <=
- Re: struct.el -- a package to encode/decode binary data, Stefan Monnier, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Eli Zaretskii, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Stefan Monnier, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Eli Zaretskii, 2002/03/22
- Re: struct.el -- a package to encode/decode binary data, Miles Bader, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Richard Stallman, 2002/03/22
- Re: struct.el -- a package to encode/decode binary data, Stefan Monnier, 2002/03/21
- Re: struct.el -- a package to encode/decode binary data, Richard Stallman, 2002/03/22
Re: struct.el -- a package to encode/decode binary data, Kenichi Handa, 2002/03/21