Bug 19983 – Add fast path using slice assignment to std.internal.cstring.tempCString
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-18T23:00:25Z
Last change time
2019-06-27T08:39:14Z
Assigned to
No Owner
Creator
Nathan S.
Comments
Comment #0 by n8sh.secondary — 2019-06-18T23:00:25Z
When transcoding is unnecessary the exact length of the output is known and memcpy can be used.
Comment #1 by dlang-bot — 2019-06-18T23:12:20Z
@n8sh created dlang/phobos pull request #7079 "Issue 19983 - Add fast path for std.internal.cstring.tempCString when copying an array without transcoding" mentioning this issue:
- Issue 19983 - Add fast path for std.internal.cstring.tempCString when copying an array without transcoding
https://github.com/dlang/phobos/pull/7079
Comment #2 by n8sh.secondary — 2019-06-23T08:31:29Z
Array slice assignment operations are probably fast if the type defines them. Should use them if possible for all input types, not just built-in arrays.
Comment #3 by dlang-bot — 2019-06-27T08:39:14Z
dlang/phobos pull request #7079 "Issue 19983 - Add fast path using slice assignment to std.internal.cstring.tempCString" was merged into master:
- 02659f65baafb2fb5d775b18b8be3746146ca22d by Nathan Sashihara:
Fix Issue 19983 - Add fast path using slice assignment to std.internal.cstring.tempCString
This is applicable for narrow strings when the output type matches the
string's encoding type.
https://github.com/dlang/phobos/pull/7079