COW vs. in-place.

Dave Dave_member at pathlink.com
Mon Jul 31 14:40:54 PDT 2006


Dawid Ciężarkiewicz wrote:
> Dave wrote:
> 
>> Dawid Ciężarkiewicz wrote:
>>> I'd rather wait till const/immutability in D problem will be resolved.
>>> Don't forget that additional "option" is runtime cost. There are some
>>> propositions of const/immutability that could help providing compile time
>>> information to deal with your proposition.
>> It would take many calls to the modified toupper to cost as much as
>> needlessly duplicating one large text file, and now you have to either
>> live with the dups or write your own in-place toupper <g>
> 
> Yes. Still - I'd rather see duplicated functions for that or something like
> it (just to have it in compile time).
>  
>> None of the const/immutability ideas will take care of having to "copy
>> on write"; they were all more-or-less just ways of enforcing COW so
>> there wouldn't be mistakes.
> 
> Well, right.
> 
> Maybe just writting new module (std.strinplace) that do what you want and
> then sending it to Walter/D discussion group is good . I guess with newday
> import improvements names could stay like they were and people interested
> in this speedup would statically import this module and use FQN where they
> want such behavior.

Not a bad idea... The main prob. would be that there would be a lot of 
duplication of code.



More information about the Digitalmars-d mailing list