Replacing std.xml

Jonathan M Davis jmdavisProg at gmx.com
Thu Aug 29 12:34:52 PDT 2013


On Thursday, August 29, 2013 21:28:09 Jacob Carlborg wrote:
> On 2013-08-29 19:38, Jonathan M Davis wrote:
> > However, because all of the XML special symbols should be ASCII, you
> > should
> > still be able to avoid decoding characters for the most part. It's only
> > when you have to actually look at the content that Unicode would
> > potentially matter. So, the performance hit of decoding Unicode
> > characters should mostly be able to be avoided.
> 
> I don't understand. If use a range of dchar and call "front" and
> "popFront" won't it do decoding then?

Any decent parser is going to special-case strings (especially if it's using 
slicing), in which case, it won't call front unless it needs to decode. The 
only real question is whether generic char and wchar ranges should be 
supported, because then you could avoid the decoding for ranges that aren't 
strings, but strings are already covered simply by special casing. You really
can't afford to not special-case for strings for algorithms in general if
efficiency is a high priority.

- Jonathan M Davis


More information about the Digitalmars-d mailing list