std.xml should just go

Jacob Carlborg doob at me.com
Sun Feb 6 02:43:08 PST 2011


On 2011-02-04 21:44, Jeff Nowakowski wrote:
> On 02/03/2011 10:07 PM, Walter Bright wrote:
>>
>> The way to get a high performance string parser in D is to take
>> advantage of one of D's unique features - slices. Java, C++, C#, etc.,
>> all rely on copying strings. With D you can just use slices into the
>> original XML source text. If you're copying the text, you're doing it
>> wrong.
>
> Java's substring() does not copy the text, at least in the official JDK
> implementation. Unfortunately, it doesn't specify this behavior as part
> of the String API.

But, I assume, it will allocate a new instance of String even though the 
content point to the same data?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list