From: Yukihiro Matsumoto Date: 2008-03-24T17:29:42+09:00 Subject: Re: Changing the algorithm of String#* Hi, In message "Re: Changing the algorithm of String#*" on Sun, 23 Mar 2008 05:44:06 +0900, apeiros writes: |I recently played around and found String#* to be rather slow, |wondering why I dug in the source and found it copied only linearly. |That can be reduced to a logarithmic copying, so I rewrote the code to |use an algorithm of logarithmic complexity. Please note that my C-fu |is rather weak, so please peer-review to code. |I hope you deem it worthy to be used in ruby :) |Zenspider btw. pointed out, that the same could be used with Array#*. | |The rewritten rb_str_times routine in string.c: Does this make any meaningful difference? memcpy(), which is O(n) seems significant. matz.