Project

Profile

Help

Bug #4743

closed

Performance: substring() and subsequence()

Added by Michael Kay about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2020-09-21
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

substring() is implemented by creating an array of codepoints, and calling subsequence() on this array.

subsequence() is implemented using array.filter() - it looks at each item to see if it is within the specified range.

This is a rather inefficient way of selecting a small subsequence of a large string or array.

Please register to edit this issue

Also available in: Atom PDF Tracking page