Jump to page: 1 24  
Page
Thread overview
force inline/not-inline
Mar 17, 2012
Manu
Mar 18, 2012
Adrian
Mar 18, 2012
Manu
Aug 24, 2013
Temtaime
Aug 24, 2013
jerro
Jul 26, 2015
Brandon Ragland
Jul 26, 2015
Gary Willoughby
Jul 27, 2015
Jonathan M Davis
Jul 27, 2015
Marc Schütz
Jul 27, 2015
tcak
Jul 28, 2015
Daniel Murphy
Jul 28, 2015
Adrian Matoga
Jul 28, 2015
Marc Schütz
Jul 28, 2015
Tofu Ninja
Jul 28, 2015
Jonathan M Davis
Jul 28, 2015
David Nadlinger
Jul 28, 2015
David Nadlinger
Jul 30, 2015
Jonathan M Davis
Jul 31, 2015
Iain Buclaw
Jul 30, 2015
David Nadlinger
Jul 31, 2015
Kagamin
Jul 28, 2015
Brandon Ragland
Jul 29, 2015
David Nadlinger
Jul 29, 2015
Iain Buclaw
Jul 29, 2015
Meta
Jul 28, 2015
Jonathan M Davis
Jul 29, 2015
Brandon Ragland
Jul 28, 2015
David Nadlinger
Jul 29, 2015
ketmar
Jul 29, 2015
David Nadlinger
Aug 04, 2015
ketmar
Aug 01, 2015
Daniel Murphy
Jul 27, 2015
Joakim
Jul 27, 2015
Guillaume Chatelet
March 17, 2012
I just started writing an emulator in D for some fun; I needed an
application to case-study aggressive performance characteristics in
hot-loop situations.
I know this has come up time and time again, but I just want to put it out
there again... if I were shipping this product, I would NEED forceinline +
force-not-inline.

I know D likes to try and intelligently inline code, but in these very high performance cases, I know what's best for my code, and I have also shipped this product commercially before. I know exactly what was required of it from months of meticulous performance profiling, and I can see immediately that D is not making the right choices. Programmers need to be able to explicitly control to inline-ing in many cases.

Cross module inline-ing is a really big problem. What is the plan here? Is there a solution in the foreseeable future? What about libs?


March 17, 2012
On 17-03-2012 23:53, Manu wrote:
> I just started writing an emulator in D for some fun; I needed an
> application to case-study aggressive performance characteristics in
> hot-loop situations.
> I know this has come up time and time again, but I just want to put it
> out there again... if I were shipping this product, I would NEED
> forceinline + force-not-inline.
>
> I know D likes to try and intelligently inline code, but in these very
> high performance cases, I know what's best for my code, and I have also
> shipped this product commercially before. I know exactly what was
> required of it from months of meticulous performance profiling, and I
> can see immediately that D is not making the right choices. Programmers
> need to be able to explicitly control to inline-ing in many cases.

Amen.

>
> Cross module inline-ing is a really big problem. What is the plan here?
> Is there a solution in the foreseeable future? What about libs?

-- 
- Alex
March 18, 2012
Am 17.03.2012 23:53, schrieb Manu:
> I just started writing an emulator in D for some fun; I needed an
> application to case-study aggressive performance characteristics in
> hot-loop situations.
> I know this has come up time and time again, but I just want to put it
> out there again... if I were shipping this product, I would NEED
> forceinline + force-not-inline.
>
> I know D likes to try and intelligently inline code, but in these very
> high performance cases, I know what's best for my code, and I have also
> shipped this product commercially before. I know exactly what was
> required of it from months of meticulous performance profiling, and I
> can see immediately that D is not making the right choices. Programmers
> need to be able to explicitly control to inline-ing in many cases.
>
> Cross module inline-ing is a really big problem. What is the plan here?
> Is there a solution in the foreseeable future? What about libs?
+1

Currently I use string mixins to force inlining - but that's uggly
March 18, 2012
On 18 March 2012 10:56, Adrian <adrian.remove-nospam@veith-system.de> wrote:

> +1
>
> Currently I use string mixins to force inlining - but that's uggly
>

Yeah, that's not an acceptable workaround. I couldn't write commercial/large-team code that way.


August 24, 2013
Bump.
Will forceinline be introduced?
August 24, 2013
On Saturday, 17 March 2012 at 22:53:58 UTC, Manu wrote:
> I just started writing an emulator in D for some fun; I needed an
> application to case-study aggressive performance characteristics in
> hot-loop situations.
> I know this has come up time and time again, but I just want to put it out
> there again... if I were shipping this product, I would NEED forceinline +
> force-not-inline.

You could use GDC and @attribute("forceinline") and
@attribute("noinline"). But I agree it would be nice to have
something like that as a part of the language.
July 26, 2015
On Saturday, 24 August 2013 at 19:13:49 UTC, jerro wrote:
> On Saturday, 17 March 2012 at 22:53:58 UTC, Manu wrote:
>> I just started writing an emulator in D for some fun; I needed an
>> application to case-study aggressive performance characteristics in
>> hot-loop situations.
>> I know this has come up time and time again, but I just want to put it out
>> there again... if I were shipping this product, I would NEED forceinline +
>> force-not-inline.
>
> You could use GDC and @attribute("forceinline") and
> @attribute("noinline"). But I agree it would be nice to have
> something like that as a part of the language.

Don't mean to resurrect an old thread but was working n a project to replace a few C programs today, that are time-sensitive and process fairly large batches of files, for live-use.

Was looking for a way to inline a few function calls that could shave a few seconds off my run time today, ended up using GDC attribute flags but was hoping the language had this feature.

Though I understand it intelligently decides, sometimes it doesn't do so well.

Case in point might be a call that at first glance doesn't get called often, but when in production, gets called thousands of times. That could be massive savings if it were able to force inline.

-Brandon
July 26, 2015
On Sunday, 26 July 2015 at 21:58:02 UTC, Brandon Ragland wrote:
> On Saturday, 24 August 2013 at 19:13:49 UTC, jerro wrote:
>> [...]
>
> Don't mean to resurrect an old thread but was working n a project to replace a few C programs today, that are time-sensitive and process fairly large batches of files, for live-use.
>
> Was looking for a way to inline a few function calls that could shave a few seconds off my run time today, ended up using GDC attribute flags but was hoping the language had this feature.
>
> Though I understand it intelligently decides, sometimes it doesn't do so well.
>
> Case in point might be a call that at first glance doesn't get called often, but when in production, gets called thousands of times. That could be massive savings if it were able to force inline.
>
> -Brandon

It looks like support is being considered:

http://dlang.org/pragma.html#inline
July 27, 2015
On Sunday, 26 July 2015 at 22:59:49 UTC, Gary Willoughby wrote:
> It looks like support is being considered:
>
> http://dlang.org/pragma.html#inline

Yeah. IIRC, there was a big discussion a few months back on how pragma(inline) worked vs how it should work. In particular, I think that there was a big dispute over whether pragma(inline, true) should force inlining outright or make it so that it gave you an error if it wasn't inlined. I'd have to go find that discussion and dig through it though to know for sure what was being discussed exactly. I paid some attention to it, but not a lot.

- Jonathan M Davis
July 27, 2015
On Sunday, 26 July 2015 at 21:58:02 UTC, Brandon Ragland wrote:
> On Saturday, 24 August 2013 at 19:13:49 UTC, jerro wrote:
>> On Saturday, 17 March 2012 at 22:53:58 UTC, Manu wrote:
>>> I just started writing an emulator in D for some fun; I needed an
>>> application to case-study aggressive performance characteristics in
>>> hot-loop situations.
>>> I know this has come up time and time again, but I just want to put it out
>>> there again... if I were shipping this product, I would NEED forceinline +
>>> force-not-inline.
>>
>> You could use GDC and @attribute("forceinline") and
>> @attribute("noinline"). But I agree it would be nice to have
>> something like that as a part of the language.
>
> Don't mean to resurrect an old thread but was working n a project to replace a few C programs today, that are time-sensitive and process fairly large batches of files, for live-use.
>
> Was looking for a way to inline a few function calls that could shave a few seconds off my run time today, ended up using GDC attribute flags but was hoping the language had this feature.
>
> Though I understand it intelligently decides, sometimes it doesn't do so well.
>
> Case in point might be a call that at first glance doesn't get called often, but when in production, gets called thousands of times. That could be massive savings if it were able to force inline.

It's in, merged a couple months ago, will be in the upcoming 2.068 release:

https://github.com/D-Programming-Language/dmd/pull/4723
« First   ‹ Prev
1 2 3 4