Major performance problem with std.array.front()
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Mar 10 20:35:10 PDT 2014
On 3/10/14, 8:05 PM, Steven Schveighoffer wrote:
> I think you are missing what I'm saying, I don't want the allocation
> eliminated, but if we eliminate some allocations with [] and not others,
> it will be confusing. The path I'd always hoped we would go in was to
> make all array literals immutable, and make allocation of mutable arrays
> on the heap explicit.
>
> Adding eliding of some allocations for optimization is good, but I (and
> I think possibly Dicebot) think all array literals should not allocate.
I think so too. But that's irrelevant because arrays do allocate (at
least behave as if they did) and that's how the cookie crumbles.
D is a wonderful language, and is getting better literally by day. There
is a lot more in using it in new and interesting ways, than in brooding
about its inevitable imperfections.
Andrei
More information about the Digitalmars-d
mailing list