Does D have "structural sharing" of immutable collections?

Roman D. Boiko rb at d-coding.com
Wed May 23 14:58:42 PDT 2012


On Wednesday, 23 May 2012 at 21:12:04 UTC, Jonathan M Davis wrote:
> In my personal experience, that's not true at all. I've seen 
> _huge_
> performance problems in Haskell when using a map. There may be 
> cases where an
> immutable container may not pose large performance problems, 
> but I would be
> _very_ wary of using immutable containers, and _very_ careful 
> with them when I
> did.
>
> - Jonathan M Davis

I expect problems with eliminating tail calls (especially for 
mutually recursive functions), but cannot find any other reason, 
theoretical or implementation, that would necessarily make it 
execute slowly in D. I think that cache friendliness is possible 
to achieve, at least in my use cases. What else could go wrong?


More information about the Digitalmars-d mailing list