backporting features to D1

Denis Koroskin 2korden at gmail.com
Sun Oct 12 12:44:59 PDT 2008


On Sun, 12 Oct 2008 23:32:15 +0400, Frank Benoit  
<keinfarbton at googlemail.com> wrote:

> Christopher Wright schrieb:
>> Frank Benoit wrote:
>>> How can you guess anything here?
>>>
>>> Old behavior == just the direct call, no extra cost New behavior ==
>>>  same direct call plus a heap allocation with unbound cost
>>
>> There are plenty of randomized algorithms with potentially unbounded
>> cost that are still used. In practice, potentially unbounded things
>> work in a reasonable amount of time or get replaced.
>>
>
> You said it is just a thing of optimization.
> That would be true if the runtime would have been increased by a defined
> value, like double runtime. But it has changed from deterministic
> behavior to undeterministic behavior.
> => that means you can no longer use that in code that is made for high
> data rate or low latency. And optimizations will not change that.
>
> There is also no sense in doing benchmarks, because you are
> measuring the GC performance, nothing more. And I already know, that I
> need the guarantee for no heap allocation.
>
> My point is, the delegate are a D1 tool that can be used in high
> performance code. Shortly after the full closure feature was announced
> (Nov 07), it was shown that this brakes D1 runtime behavior. Still this
> is not fixed.
>
>> While this does violate Tango's contracts about heap allocation, once
>>  scope delegates are available, it won't take much work to replace
>> "delegate" with "scope delegate" everywhere in Tango.
>
> I understand this as a confirmation, that with actual D2 you cannot port
> tango and expect it to work as it does with D1.
> Even an optimization cannot help. IMO the only two possible solutions are
> 1. Redesign the code -or-
> 2. Wait for scoped delegate
>

Scoped delegates hopefully will be implemented some day, so I'd stick with  
#2 in a long run.



More information about the Digitalmars-d mailing list