http://d.puremagic.com/issues/show_bug.cgi?id=9725

           Summary: std.string.format does wasteful UTF decoding
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: performance
          Severity: normal
          Priority: P3
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Vladimir Panteleev <[email protected]> 2013-03-15 
06:14:17 EET ---
import std.string; void main() { format("\xFF"); }

This program throws, indicating that the "format" function performs UTF-8
decoding.

This is a pointless waste of cycles. All format specifiers are in the
lower-ASCII range, and both the input and output are UTF-8. Should the format
specifier syntax require reading exactly one Unicode character, it should do so
when required, rather than reading the entire string one dchar at a time, then
encoding the results back into an UTF-8 string.

It is worth noting that writefln does not have the same issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to