From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld Newsgroups: gmane.emacs.devel Subject: Re: why is reverse a string in-place so much slower than a vector? Date: Fri, 25 Apr 2014 10:55:59 +0200 Message-ID: <3673186.oJyHOS7TOs@descartes> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1398416198 22382 80.91.229.3 (25 Apr 2014 08:56:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Apr 2014 08:56:38 +0000 (UTC) Cc: Leo Liu To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 25 10:56:31 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wdbvo-0000xT-Hq for ged-emacs-devel@m.gmane.org; Fri, 25 Apr 2014 10:56:28 +0200 Original-Received: from localhost ([::1]:56643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wdbvo-00061A-7L for ged-emacs-devel@m.gmane.org; Fri, 25 Apr 2014 04:56:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wdbve-0005nd-GS for emacs-devel@gnu.org; Fri, 25 Apr 2014 04:56:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdbvW-0001PF-UB for emacs-devel@gnu.org; Fri, 25 Apr 2014 04:56:18 -0400 Original-Received: from ptmx.org ([178.63.28.110]:57037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdbvW-0001Ns-Ny for emacs-devel@gnu.org; Fri, 25 Apr 2014 04:56:10 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 9127829EC2; Fri, 25 Apr 2014 10:56:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E3FKi+xEE+uD; Fri, 25 Apr 2014 10:56:06 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id B2B0D228EF; Fri, 25 Apr 2014 10:56:06 +0200 (CEST) User-Agent: KMail/4.13 (Linux/3.13.0-24-generic; KDE/4.13.0; x86_64; ; ) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.28.110 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171622 Archived-At: On Friday 25 April 2014 16:17:42 Leo Liu wrote: > So why is this so much slower on string? This is a bit of a guess. But I think the problem is that `aref' has t= o do=20 more complicated operations for multi-byte strings to correctly decode = them. =20 While for a vector it can simply access every single bytes. (with-current-buffer "subr.el" (multibyte-string-p (buffer-substring (p= oint- min) (point-max)))) -> t Regards, R=C3=BCdiger