[Issue 11017] New: std.string/uni.toLower is very slow
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 12 10:52:35 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11017
Summary: std.string/uni.toLower is very slow
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: peter.alexander.au at gmail.com
--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2013-09-12 10:52:33 PDT ---
char[] s = new char[10_000_000];
s[] = 'A';
auto s2 = s.toLower;
This takes 4.3 seconds on my machine.
char[] s = new char[10_000_000];
s[] = 'A';
auto s2 = s.map!toLower.to!string;
This only takes 1.1 seconds.
Looking at the code for std.uni.toLower, it appears the string is constructed
using repeated ~=. It should use an Appender of some sort.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list