From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: struct.el -- a package to encode/decode binary data Date: 21 Mar 2002 16:36:42 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: <5x663qgcfp.fsf@kfs2.cua.dk> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016724994 9140 127.0.0.1 (21 Mar 2002 15:36:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 21 Mar 2002 15:36:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16o4cE-0002NJ-00 for ; Thu, 21 Mar 2002 16:36:34 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16o4iU-0000VK-00 for ; Thu, 21 Mar 2002 16:43:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16o4c1-0002QD-00; Thu, 21 Mar 2002 10:36:21 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16o4bV-0002MX-00 for ; Thu, 21 Mar 2002 10:35:49 -0500 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id BC6057C035; Thu, 21 Mar 2002 15:35:45 +0000 (GMT) Original-To: Eli Zaretskii In-Reply-To: Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2097 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2097 Eli Zaretskii 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 http://www.cua.dk _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel