Creeping Bloat in Phobos

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 28 12:57:17 PDT 2014


On 9/28/2014 11:51 AM, bearophile wrote:
> Walter Bright:
>
>> but do want to stop adding more autodecoding functions like the proposed
>> std.path.withExtension().
>
> I am not sure that can work. Perhaps you need to create a range2 and algorithm2
> modules, and keep adding some autodecoding functions to the old modules.

It can work just fine, and I wrote it. The problem is convincing someone to pull 
it :-( as the PR was closed and reopened with autodecoding put back in.

As I've explained many times, very few string algorithms actually need decoding 
at all. 'find', for example, does not. Trying to make a separate universe out of 
autodecoding algorithms is missing the point.

Certainly, setExtension() does not need autodecoding, and in fact all the 
autodecoding in it does is slow it down, allocate memory on errors, make it 
throwable, and produce dchar output, meaning at some point later you'll need to 
put it back to char.

I.e. there are no operations on paths that require decoding.

I know that you care about performance - you post about it often. I would expect 
that unnecessary and pervasive decoding would be of concern to you.


More information about the Digitalmars-d mailing list