Re: Slow UDF call?

2019-08-18 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Aug 17, 2019 at 09:42:00PM +, Giovanni Di Maria via Digitalmars-d-learn wrote: [...] > I have also compiled with: > dmd program.d -O -release -inline -boundscheck=off > > and the execution speed is very very fast. [...] If performance is important to you, I recommend checking out

Re: Slow UDF call?

2019-08-17 Thread Giovanni Di Maria via Digitalmars-d-learn
On Saturday, 17 August 2019 at 20:57:44 UTC, Giovanni Di Maria wrote: On Saturday, 17 August 2019 at 20:15:02 UTC, Stefan Koch wrote: On Saturday, 17 August 2019 at 19:43:22 UTC, Giovanni Di Maria wrote: [...] Yes they do A function call has a cost. In case of a function which performes a 1

Re: Slow UDF call?

2019-08-17 Thread Giovanni Di Maria via Digitalmars-d-learn
On Saturday, 17 August 2019 at 20:15:02 UTC, Stefan Koch wrote: On Saturday, 17 August 2019 at 19:43:22 UTC, Giovanni Di Maria wrote: [...] Yes they do A function call has a cost. In case of a function which performes a 1 cycle (nominally without ILP) operation, the overhead of the

Re: Slow UDF call?

2019-08-17 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 17 August 2019 at 19:43:22 UTC, Giovanni Di Maria wrote: Hi, i have seen that a simple operation (in a loop) is faster than the equivalent UDF. The first example takes 4 seconds, the second example takes 16 seconds. Local variables influence the speed of execution? Thank you very

Slow UDF call?

2019-08-17 Thread Giovanni Di Maria via Digitalmars-d-learn
Hi, i have seen that a simple operation (in a loop) is faster than the equivalent UDF. The first example takes 4 seconds, the second example takes 16 seconds. Local variables influence the speed of execution? Thank you very much. Giovanni == import