[cmucl] #81: Reversing a string is slow
cmucl
cmucl-devel at common-lisp.net
Sun May 19 00:39:08 UTC 2013
#81: Reversing a string is slow
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2013-05
Keywords: |
--------------------+-------------------------------------------------------
Comment(by rtoy):
Here is another test, with surrogate pairs:
{{{
(defparameter *s2* (lisp::codepoints-string (loop for k from 0 below
1000000 collect (+ 65536 k))))
(time (prog1 t (time-rev *s2*)))
; Compiling LAMBDA NIL:
; Compiling Top-Level Form:
; Evaluation took:
; 10.08 seconds of real time
; 10.050677 seconds of user run time
; 0.017808 seconds of system run time
; 30,831,596,637 CPU cycles
; [Run times include 0.14 seconds GC run time]
; 0 page faults and
; 400,215,072 bytes consed.
}}}
Although the string is twice as long (because of the surrogates), the time
is the same.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/81#comment:1>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
More information about the cmucl-ticket
mailing list