Bug 19405 – Speed up backwards UTF-8 decoding in stripRight & make nogc nothrow for strings

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-11-16T07:51:34Z
Last change time
2018-11-16T10:16:10Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-11-16T07:51:34Z
The backwards UTF-8 decoding in stripRight can be substantially sped up. With the improvements it also becomes faster than foreach_reverse(dchar c; s) for strings, so we can use it for strings and make them `@nogc` nothrow.
Comment #1 by n8sh.secondary — 2018-11-16T08:53:04Z
Comment #2 by github-bugzilla — 2018-11-16T10:16:09Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/f22d322d0fc94e79be50797b2871d62740d1bf67 Fix Issue 19405 - Speed up backwards UTF-8 decoding in stripRight & make nogc nothrow for strings https://github.com/dlang/phobos/commit/e6719075de7ba3ac9aa141325882bc98f30e1eaa Merge pull request #6771 from n8sh/issue-19405 Fix Issue 19405 - Speed up backwards UTF-8 decoding in stripRight & make nogc nothrow for strings