Slow performance compared to C++, ideas?

Manu turkeyman at gmail.com
Mon Jun 3 09:25:11 PDT 2013


On 4 June 2013 01:28, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>wrote:

> On 6/3/13 3:05 AM, Manu wrote:
>
>> On 3 June 2013 02:37, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org
>> <mailto:SeeWebsiteForEmail@**erdani.org <SeeWebsiteForEmail at erdani.org>>>
>> wrote:
>>
>>     On 6/2/13 9:59 AM, Manu wrote:
>>
>>         I've never said that virtuals are bad. The key function of a
>>         class is
>>         polymorphism.
>>         But the reality is that in non-tool or container/foundational
>>         classes
>>         (which are typically write-once, use-lots; you don't tend to
>>         write these
>>         daily), a typical class will have a couple of virtuals, and a
>> whole
>>         bunch of properties.
>>
>>
>>     I've argued if no dispatch is needed just make those free functions.
>>
>>
>> You're not going to win many friends, and probably not many potential D
>> users by insisting people completely change their coding patterns that
>> they've probably held for decades on a trivial matter like this.
>>
>
> This is actually part of the point. You keep on discussing as if we design
> the language now, when in fact there's a lot of code out there that relies
> on the current behavior. We won't win many friends if we break every single
> method that has ever been overridden in D, over a trivial matter.


You won't break every single method, they already went through that
recently when override was made a requirement.
It will only break the base declarations, which are far less numerous.

How can you justify the change to 'override' with a position like that? We
have already discussed that we know PRECISELY the magnitude of breakage
that will occur.
It is: magnitude_of_breakage_from_override /
total_number_of_derived_classes. A much smaller number than the breakage
which was gladly accepted recently.

And the matter is far from trivial. In fact, if you think this is trivial,
then how did the override change ever get accepted? That is most certainly
trivial by contrast, and far more catastrophic in terms of breakage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130604/a62ce304/attachment-0001.html>


More information about the Digitalmars-d mailing list