Re: Inlining Ref Functions

2009-05-18 Thread Bill Baxter
On Sun, May 17, 2009 at 11:12 AM, grauzone wrote: > grauzone wrote: >> >> Bill Baxter wrote: >>> >>> On Fri, May 15, 2009 at 9:16 PM, grauzone wrote: > > 1.  Some uber-hardcore performance freaks will not even consider D if > it > has the > slightest bit of performance overhea

Re: Inlining Ref Functions

2009-05-17 Thread dsimcha
== Quote from Denis Koroskin (2kor...@gmail.com)'s article > On Sat, 16 May 2009 00:36:16 +0400, dsimcha wrote: > > The fact that DMD does not inline functions with ref parameters has come > > up > > several times deep in threads on this NG before, but it's never really > > received proper attenti

Re: Inlining Ref Functions

2009-05-17 Thread grauzone
grauzone wrote: Bill Baxter wrote: On Fri, May 15, 2009 at 9:16 PM, grauzone wrote: 1. Some uber-hardcore performance freaks will not even consider D if it has the slightest bit of performance overhead compared to C++. I don't understand why D should pander to C++ freaks? If they think thei

Re: Inlining Ref Functions

2009-05-17 Thread Denis Koroskin
On Sat, 16 May 2009 00:36:16 +0400, dsimcha wrote: > The fact that DMD does not inline functions with ref parameters has come > up > several times deep in threads on this NG before, but it's never really > received proper attention. After changing a few swaps in > performance-critical > area

Re: Inlining Ref Functions

2009-05-17 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article > Performance is one of the major selling points of D. Why settle for a > language with sub-standard tools and lack of safety if you don't care > about performance? If you don't care about performance you're > probably better off with one of

Re: Inlining Ref Functions

2009-05-17 Thread grauzone
Bill Baxter wrote: On Fri, May 15, 2009 at 9:16 PM, grauzone wrote: 1. Some uber-hardcore performance freaks will not even consider D if it has the slightest bit of performance overhead compared to C++. I don't understand why D should pander to C++ freaks? If they think their language is grea

Re: Inlining Ref Functions

2009-05-17 Thread Bill Baxter
On Fri, May 15, 2009 at 9:16 PM, grauzone wrote: >> 1.  Some uber-hardcore performance freaks will not even consider D if it >> has the >> slightest bit of performance overhead compared to C++. > > I don't understand why D should pander to C++ freaks? If they think their > language is great, they'

Re: Inlining Ref Functions

2009-05-16 Thread Daniel Keep
dsimcha wrote: > == Quote from grauzone (n...@example.net)'s article >> Of course, this doesn't have to do with DMD's optimizer. That said, if >> you want heavy optimization, you rather should look at LDC or GDC. > > In general I agree. There are higher priorities than improving DMD's > optimiz

Re: Inlining Ref Functions

2009-05-16 Thread bearophile
I have compiled a small variant of your code with the a very new LDC compiler (May 9 revision, it doesn't print the revision number), the code: import tango.stdc.stdio: printf; import Integer = tango.text.convert.Integer; void swap(T)(ref T a, ref T b) { T temp = a; a = b; b = temp;

Re: Inlining Ref Functions

2009-05-15 Thread dsimcha
== Quote from grauzone (n...@example.net)'s article > Of course, this doesn't have to do with DMD's optimizer. That said, if > you want heavy optimization, you rather should look at LDC or GDC. In general I agree. There are higher priorities than improving DMD's optimization back end. This is a

Re: Inlining Ref Functions

2009-05-15 Thread grauzone
On second thought, maybe this should be a high priority issue, for two reasons. 1. Some uber-hardcore performance freaks will not even consider D if it has the slightest bit of performance overhead compared to C++. I don't understand why D should pander to C++ freaks? If they think their lang

Re: Inlining Ref Functions

2009-05-15 Thread dsimcha
== Quote from Michel Fortin (michel.for...@michelf.com)'s article > Which makes me think: now that "this" in structs is now a "ref" > parameter, does that mean that all non-static member functions of a > struct won't be inlined? Oddly enough, based on looking at some disassembly, DMD apparently in

Re: Inlining Ref Functions

2009-05-15 Thread Michel Fortin
On 2009-05-15 16:36:16 -0400, dsimcha said: The fact that DMD does not inline functions with ref parameters has come up several times deep in threads on this NG before, but it's never really received proper attention. After changing a few swaps in performance-critical areas of my code to "manu

Re: Inlining Ref Functions

2009-05-15 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article > Well it was shown before in a demo ray-tracer that the inability to > inline funcs with refs caused a significant speed hit under DMD. And > now we're seeing it's causing a significant speed hit for sorting > because of swap routines. > The

Re: Inlining Ref Functions

2009-05-15 Thread Bill Baxter
Well it was shown before in a demo ray-tracer that the inability to inline funcs with refs caused a significant speed hit under DMD. And now we're seeing it's causing a significant speed hit for sorting because of swap routines. There may be some thorny issues regarding inlining with refs in the

Re: Inlining Ref Functions

2009-05-15 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article > On Fri, May 15, 2009 at 1:36 PM, dsimcha wrote: > > The fact that DMD does not inline functions with ref parameters has come > up > > several times deep in threads on this NG before, but it's never really > > received proper attention.  Aft

Re: Inlining Ref Functions

2009-05-15 Thread Bill Baxter
On Fri, May 15, 2009 at 1:36 PM, dsimcha wrote: > The fact that DMD does not inline functions with ref parameters has come up > several times deep in threads on this NG before, but it's never really > received proper attention.  After changing a few swaps in performance-critical > areas of my code

Inlining Ref Functions

2009-05-15 Thread dsimcha
The fact that DMD does not inline functions with ref parameters has come up several times deep in threads on this NG before, but it's never really received proper attention. After changing a few swaps in performance-critical areas of my code to "manually inlined" swaps and seeing significant speed