Lots of low hanging fruit in Phobos

Walter Bright newshound2 at digitalmars.com
Thu Mar 6 14:20:43 PST 2014


On 3/6/2014 1:40 PM, Meta wrote:
> Seems like a good idea to reduce memory usage wherever possible, but I thought
> that the reason std.string exists (and duplicates some functionality that exists
> elsewhere) is to provide string-specific versions that were either optimized
> specifically for strings, or have completely different functionality due to
> working with strings.

1. By using template specializations, algorithms can be custom optimized for 
certain inputs.

2. I expect the developer of these algorithms to do performance profiling of 
them vs the originals, and address any problems.

3. I've done some similar algorithms, and was able to achieve performance 
parity, and sometimes even do better (because no memory needed to be allocated).


std.string was one of the first Phobos modules written, was written by myself, 
and long predates notions of ranges and algorithms. It has evolved since then, 
but its fundamental nature has not changed. It's time for that to change to a 
modern, D style.



More information about the Digitalmars-d mailing list