string is rarely useful as a function argument

Walter Bright newshound2 at digitalmars.com
Thu Dec 29 01:02:18 PST 2011


On 12/29/2011 12:12 AM, Gor Gyolchanyan wrote:
> This a a great idea! In this case the default string will be a
> random-access range, not a bidirectional range. Also, processing
> dstring is faster, then string, because no encoding needs to be done.
> Processing power is more expensive, then memory. utf-8 is valuable
> only to pass it as an ASCII string (which is not too common) and to
> store large chunks of it. Both these cases are much less common then
> all the rest of string processing.

dstring consumes 4x the memory, and this can easily cause perf degradations due 
to thrashing and poor cache locality.


More information about the Digitalmars-d mailing list