Re: Detecting performance pitfall in array access

2020-05-17 Thread Adnan via Digitalmars-d-learn
On Sunday, 17 May 2020 at 09:41:55 UTC, Johan wrote: On Sunday, 17 May 2020 at 03:30:57 UTC, Adnan wrote: Hello, I am trying to examine what causes my similar D solution to lag behind performance. In the link, they don't have ldc or gdc but according to my machine, the dmd generated code isn'

Re: Detecting performance pitfall in array access

2020-05-17 Thread Adnan via Digitalmars-d-learn
On Sunday, 17 May 2020 at 11:39:30 UTC, kinke wrote: As a side note, using jagged arrays for multiple dimensions should probably be avoided whenever you can. By jagged array, do you mean vector of vectors? What would be an alternative?

Re: Detecting performance pitfall in array access

2020-05-17 Thread kinke via Digitalmars-d-learn
On Sunday, 17 May 2020 at 11:39:30 UTC, kinke wrote: DMD v2.091: * dmd -m64 -O -release -boundscheck=off -run ..\speed.d aa bbc: ~11 μs I forgot `-inline` for DMD; that reduces the speed, yielding ~16 μs.

Re: Detecting performance pitfall in array access

2020-05-17 Thread kinke via Digitalmars-d-learn
On Sunday, 17 May 2020 at 03:30:57 UTC, Adnan wrote: In my machine, if you feed "aa" and "bbc" to the function, ldc generated code takes around 400 microseconds. I don't have an access to gdc in my machine. https://imgshare.io/image/NN8Xmp Full code: D : https://run.dlang.io/is/vLj7BC

Re: Detecting performance pitfall in array access

2020-05-17 Thread Johan via Digitalmars-d-learn
On Sunday, 17 May 2020 at 03:30:57 UTC, Adnan wrote: Hello, I am trying to examine what causes my similar D solution to lag behind performance. In the link, they don't have ldc or gdc but according to my machine, the dmd generated code isn't really far behind ldc generated code. https://img

Detecting performance pitfall in array access

2020-05-16 Thread Adnan via Digitalmars-d-learn
Hello, I am trying to examine what causes my similar D solution to lag behind performance. In the link, they don't have ldc or gdc but according to my machine, the dmd generated code isn't really far behind ldc generated code. So here is the actual code: ulong levenshteinEditDistance(T)(in