Slow performance compared to C++, ideas?

Steven Schveighoffer schveiguy at yahoo.com
Thu Jun 6 10:55:58 PDT 2013


On Thu, 06 Jun 2013 13:50:11 -0400, deadalnix <deadalnix at gmail.com> wrote:

> On Thursday, 6 June 2013 at 15:06:38 UTC, Kapps wrote:
>> On Thursday, 6 June 2013 at 01:08:36 UTC, deadalnix wrote:
>>> This is why I wrote that this may have been true in the past.  
>>> Nevertheless, it is completely false today.
>>
>> C# often does not inline virtual methods, and even if it can inline  
>> them there's still an overhead. This (2008) article goes into depth  
>> about how it handles it:  
>> www.codeproject.com/Articles/25801/JIT-Optimizations - Essentially uses  
>> frequency analysis to determine if the virtual method call is still  
>> going to call the same method as it would previously. Regardless, we  
>> can not perform such optimizations, so whether or not it applies to C#,  
>> it does apply to D.
>>
>
> Quite frankly, I don't care what C# does. Java does it at link time, and  
> we can do it at link time the same way, that is all that matter for this  
> discussion.

How do you finalize a method with the possibility that a dynamic library  
will come along and extend that type?  Not a rhetorical question, I really  
want to know if there is a way.  Java and C# clearly have more flexibility  
there, since they are run on a VM.

-Steve


More information about the Digitalmars-d mailing list