bearophile Wrote:

> Steven Schveighoffer:
> 
> >You get a much higher speedup when things can be inlined than virtual vs. 
> >non-virtual.<
> 
> In current D compilers virtual functions prevent inlining. This can give some 
> performance loss.

People seem to think that because dcollections implement interfaces, you must 
never store a concrete collection instance.  This isn't true, you can use 
dcollections as concrete classes without dealing with interfaces at all, and 
all the functions should be inlineable (at least, they will be when I change 
them all to final functions).

dcollections provide all of the available generic-ness that you need.  Ranges, 
template member functions, etc.  AND they also implement interfaces if that 
should be part of your design.  I've pointed out that a good use case for 
passing interfaces instead of concrete classes is for dynamic libraries, where 
you don't want to have private member changes affect runtime code.

-Steve

Reply via email to