On 2/6/14, 4:29 PM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dl...@gmail.com>" wrote:
On Thursday, 6 February 2014 at 11:44:34 UTC, Michel Fortin wrote:
That thread about buildPath started like this: "Walter and I were
talking about eliminating the surreptitious allocations in buildPath".
But reference counting will do nothing to eliminate surreptitious
allocations. It can't be that problem you're trying to address.

I think stuff like buildPath just shows how the language should be
geared more towards compiler optimizations of allocation if performance
is a real goal.

The efficient thing to do is to optimize a string concat into a stack
allocation (alloca) if it is a throw-away, and just change the stack
frame upon return, with some heuristics and alternative execution paths
in order to avoid running out of stack space.

This is a very incomplete, naive sketch. It could be made to work only in a language that has no backward compatibility to worry about.

Andrei


Reply via email to