Project

General

Profile

Actions

Feature #5877

closed

Poor performance of initial and final UTF-8 substrings

Added by nex3 (Natalie Weizenbaum) over 12 years ago. Updated over 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:42049]

Description

Currently, taking the substring of a UTF-8 string always takes time proportional to the length of the string. While this is necessary in the general case, there are many common cases where it could be much faster, in particular when the substring is near the beginning of the end of the superstring. In those cases, the operation should only be proportional to the length of the substring.

Gist with reproduction and more detailed analysis forthcoming.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0