Re: [Rd] Bug: time complexity of substring is quadratic as string size and number of substrings increases

2019-02-28 Thread Tomas Kalibera
An optimized version of substring/substr is now in R-devel (76172). Best, Tomas On 2/22/19 8:16 PM, Tomas Kalibera wrote: On 2/20/19 7:55 PM, Toby Hocking wrote: Update: I have observed that stringi::stri_sub is linear time complexity, and it computes the same thing as base::substring.

Re: [Rd] Bug: time complexity of substring is quadratic as string size and number of substrings increases

2019-02-22 Thread Tomas Kalibera
On 2/20/19 7:55 PM, Toby Hocking wrote: Update: I have observed that stringi::stri_sub is linear time complexity, and it computes the same thing as base::substring. figure https://github.com/tdhock/namedCapture-article/blob/master/figure-substring-bug.png source:

Re: [Rd] Bug: time complexity of substring is quadratic as string size and number of substrings increases

2019-02-20 Thread Toby Hocking
Update: I have observed that stringi::stri_sub is linear time complexity, and it computes the same thing as base::substring. figure https://github.com/tdhock/namedCapture-article/blob/master/figure-substring-bug.png source:

[Rd] Bug: time complexity of substring is quadratic as string size and number of substrings increases

2019-02-20 Thread Toby Hocking
Hi all, (and especially hi to Tomas Kalibera who accepted my patch sent yesterday) I believe that I have found another bug, this time in the substring function. The use case that I am concerned with is when there is a single (character scalar) text/subject, and many substrings to extract. For