Old problem with performance
Weed
resume755 at mail.ru
Tue Feb 24 06:18:38 PST 2009
Christopher Wright пишет:
> Kagamin wrote:
>> Weed Wrote:
>>
>>>>> But why not allow this operation at the same speed that allows C++?
>>>> If you pass it by value you'll lose polymorphism.
>>> It is possible that this polymorphism is not needed and should be
>>> prohibited for operations by value. The class is ready, why it should
>>> not be used and have to redo it?
>>>
>>> Can not think about changing when the class is ready - he could have
>>> enormous complexity and hierarchy.
>>
>> It's probably already designed to be reference-type. I think, you'll
>> have big troubles trying to change its semantic to value-type and
>> effectively you'll have to redo it.
>
> In other words, it is not always easy to translate C++ to D. It's
> probably not worthwhile to translate any large codebase into another
> programming language, in most cases, and if you do, you will probably
> need to rewrite large portions of it anyway.
As a result, classes will be slow, or require more code to achieve
speeds comparable to C++.
That is actually a model of classes D harder than C++.
More information about the Digitalmars-d
mailing list