|
From: | Leo Liu |
Subject: | Re: why is reverse a string in-place so much slower than a vector? |
Date: | Fri, 25 Apr 2014 17:35:58 +0800 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (CentOS 6.5) |
On 2014-04-25 11:14 +0200, Andreas Schwab wrote: > String random access has linear complexity: there is a single element > cache for the last known char->byte mapping for the last accessed > string, and the runtime depends on the distance from this point. Your > rev function represents the worst case behaviour. Thanks for this piece of critical information. I guess this is all due to `string_char_to_byte'? Leo
[Prev in Thread] | Current Thread | [Next in Thread] |