emacs-devel
[Top][All Lists]
Advanced

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

Re: why is reverse a string in-place so much slower than a vector?


From: Rüdiger Sonderfeld
Subject: Re: why is reverse a string in-place so much slower than a vector?
Date: Fri, 25 Apr 2014 10:55:59 +0200
User-agent: KMail/4.13 (Linux/3.13.0-24-generic; KDE/4.13.0; x86_64; ; )

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 to do 
more complicated operations for multi-byte strings to correctly decode them.  
While for a vector it can simply access every single bytes.

(with-current-buffer "subr.el" (multibyte-string-p (buffer-substring (point-
min) (point-max))))
-> t

Regards,
Rüdiger




reply via email to

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