Major performance problem with std.array.front()

Michel Fortin michel.fortin at michelf.ca
Fri Mar 7 11:13:13 PST 2014


On 2014-03-07 14:47:26 +0000, "Kagamin" <spam at here.lot> said:

> On Friday, 7 March 2014 at 13:40:31 UTC, Michel Fortin wrote:
>> if you want to parse XML then you'll need to work with code points (in 
>> theory, in practice you might still want direct access to code units 
>> for performance reasons)
> 
> AFAIK, xml control characters are all ascii, and what's between them 
> you can slice or dup without consideration, so code units should be 
> more than enough.

If you don't fully check for well-formness (as XML parsers ought to do 
according to the XML spec) then sure you can limit yourself to ASCII. 
You'll let through illegal characters in element and attribute names 
though.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list