www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Increasing performance with static polymorphism (and other neat

reply "Atila Neves" <atila.neves gmail.com> writes:
http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

http://www.reddit.com/r/programming/comments/21tszv/increasing_performance_with_static_polymorphism/

On hacker news as well, but we know how links to that go.

Atila
Mar 31 2014
next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Atila Neves:

 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

I left ldc out because its frontend (at least the package 
currently available on Arch Linux) is older and can’t compile 
the code,<

There are updated LDC2 versions here: https://github.com/ldc-developers/ldc/releases/ Bye, bearophile
Mar 31 2014
prev sibling next sibling parent "Atila Neves" <atila.neves gmail.com> writes:
I figured, but I try not to have to compile my own binaries. I'm 
running Arch Linux so I can get the new and shiny toys without 
having to! :P

When it gets released and package I might add its numbers to the 
tables.

Atila


On Monday, 31 March 2014 at 15:04:20 UTC, bearophile wrote:
 Atila Neves:

 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

I left ldc out because its frontend (at least the package 
currently available on Arch Linux) is older and can’t compile 
the code,<

There are updated LDC2 versions here: https://github.com/ldc-developers/ldc/releases/ Bye, bearophile

Mar 31 2014
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 31 March 2014 at 14:00:28 UTC, Atila Neves wrote:
 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

 http://www.reddit.com/r/programming/comments/21tszv/increasing_performance_with_static_polymorphism/

 On hacker news as well, but we know how links to that go.

 Atila

What about -inline and -noboundscheck ?
Mar 31 2014
prev sibling next sibling parent reply "Meta" <jared771 gmail.com> writes:
On Monday, 31 March 2014 at 14:00:28 UTC, Atila Neves wrote:
 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

 http://www.reddit.com/r/programming/comments/21tszv/increasing_performance_with_static_polymorphism/

 On hacker news as well, but we know how links to that go.

 Atila

What's the title on Hackernews? I can't seem to find it.
Mar 31 2014
parent simendsjo <simendsjo gmail.com> writes:
On 03/31/2014 05:24 PM, Meta wrote:
 On Monday, 31 March 2014 at 15:22:23 UTC, Meta wrote:
 What's the title on Hackernews? I can't seem to find it.

Eh, nevermind, found it. Hackernews really needs a search function.

Perhaps we should start linking to this one instead? https://hn.algolia.com/#!/story/forever/0/Increasing%20performance%20with%20static%20polymorphism%20(and%20other%20neat%20tricks)
Mar 31 2014
prev sibling next sibling parent "Meta" <jared771 gmail.com> writes:
On Monday, 31 March 2014 at 15:22:23 UTC, Meta wrote:
 What's the title on Hackernews? I can't seem to find it.

Eh, nevermind, found it. Hackernews really needs a search function.
Mar 31 2014
prev sibling next sibling parent "Atila Neves" <atila.neves gmail.com> writes:
Good question. I forgot about those. I wish it was easier to do 
release builds with dmd. Gonna try that out now.

Atila

On Monday, 31 March 2014 at 15:20:52 UTC, John Colvin wrote:
 On Monday, 31 March 2014 at 14:00:28 UTC, Atila Neves wrote:
 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

 http://www.reddit.com/r/programming/comments/21tszv/increasing_performance_with_static_polymorphism/

 On hacker news as well, but we know how links to that go.

 Atila

What about -inline and -noboundscheck ?

Mar 31 2014
prev sibling next sibling parent "Atila Neves" <atila.neves gmail.com> writes:
I updated the results. Using those two options brings dmd a lot 
closer to gdc and even surpasses it in one benchmark. Interesting.

Atila

On Monday, 31 March 2014 at 15:41:43 UTC, Atila Neves wrote:
 Good question. I forgot about those. I wish it was easier to do 
 release builds with dmd. Gonna try that out now.

 Atila

 On Monday, 31 March 2014 at 15:20:52 UTC, John Colvin wrote:
 On Monday, 31 March 2014 at 14:00:28 UTC, Atila Neves wrote:
 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/

 http://www.reddit.com/r/programming/comments/21tszv/increasing_performance_with_static_polymorphism/

 On hacker news as well, but we know how links to that go.

 Atila

What about -inline and -noboundscheck ?


Mar 31 2014
prev sibling next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 3/31/14, 7:00 AM, Atila Neves wrote:
 http://atilanevesoncode.wordpress.com/2014/03/31/increasing-performance-with-static-polymorphism-and-other-neat-tricks/


 http://www.reddit.com/r/programming/comments/21tszv/increasing_performance_with_static_polymorphism/


 On hacker news as well, but we know how links to that go.

To search hackernews: https://hn.algolia.com. Here: https://hn.algolia.com/#!/story/forever/prefix/0/static%20polymorphis Andrei
Mar 31 2014
prev sibling next sibling parent "srean" <srean.list gmail.com> writes:
On Monday, 31 March 2014 at 15:24:03 UTC, Meta wrote:
 On Monday, 31 March 2014 at 15:22:23 UTC, Meta wrote:
 What's the title on Hackernews? I can't seem to find it.


 Hackernews really needs a search function.

Erm thats where I am coming from, the search feature is there at the bottom, take a look at the footer. I have a slightly tangential question, repeating what I asked on HN Can't the destructor issue of scopebuffer be mitigated by using hasElaborateDestructor( ) For instance have two versions one with a destructor for non POD and another without. The compiler dispatches to the appropriate one at compile time. There should not be any loss in performance.
Mar 31 2014
prev sibling next sibling parent "Meta" <jared771 gmail.com> writes:
On Monday, 31 March 2014 at 23:57:09 UTC, srean wrote:
 On Monday, 31 March 2014 at 15:24:03 UTC, Meta wrote:
 On Monday, 31 March 2014 at 15:22:23 UTC, Meta wrote:
 What's the title on Hackernews? I can't seem to find it.


 Hackernews really needs a search function.

Erm thats where I am coming from, the search feature is there at the bottom, take a look at the footer. I have a slightly tangential question, repeating what I asked on HN Can't the destructor issue of scopebuffer be mitigated by using hasElaborateDestructor( ) For instance have two versions one with a destructor for non POD and another without. The compiler dispatches to the appropriate one at compile time. There should not be any loss in performance.

Ah, you're right. That could definitely be better placed... I generally read the Hackernews RSS feed, not the site itself, so I'm not well-accustomed to the actual site.
Mar 31 2014
prev sibling next sibling parent "srean" <srean.list gmail.com> writes:
Not a question to you in particular, but dont know how to add to
a thread without replying.

I am very curious about the following (I think by the time I had
clarified my question Walter had left the building)

 I have a slightly tangential question, repeating what I asked 
 on HN

 Can't the destructor issue of scopebuffer be mitigated by using

      hasElaborateDestructor( )

 For instance have two versions one with a destructor for non  
 POD
 and another without. The compiler dispatches to the appropriate
 one at compile time. There should not be any loss in 
 performance.


Apr 01 2014
prev sibling parent "Joakim" <joakim airpost.net> writes:
On Monday, 31 March 2014 at 23:57:09 UTC, srean wrote:
 Can't the destructor issue of scopebuffer be mitigated by using

       hasElaborateDestructor( )

 For instance have two versions one with a destructor for non POD
 and another without. The compiler dispatches to the appropriate
 one at compile time. There should not be any loss in 
 performance.

Andrei suggested something similar on github a couple weeks ago: https://github.com/D-Programming-Language/phobos/pull/2014#issuecomment-37947056
Apr 01 2014