Why is this D code slower than C++?

Bradley Smith digitalmars-com at baysmith.com
Thu Jan 18 10:20:36 PST 2007


Dave wrote:
> Bradley Smith wrote:
>>   Converted templates to regular functions. (Templates not being inlined)
> 
> Are you sure? I know templates can be/are inlined and I guess I haven't 
> noticed anywhere they aren't were I'd expect a regularly defined 
> function to be inlined.

No, I'm not sure. I'm assuming based on the performance increase when 
they are manually inlined. It could very well be that template functions 
are inlined as much as regular functions, since the regular functions 
weren't being inlined either.

Thanks,
   Bradley


More information about the Digitalmars-d-learn mailing list