December 30, 2015
On Wednesday, 30 December 2015 at 00:24:38 UTC, Ilya Yaroshenko wrote:
> Awesome!
>
> Please find my notes below.

Thanks for the feedback. Good thing I posted this here before releasing it.

Funny thing, when I made the D example use the mean lambda function, it got way faster. Even with the larger array size, the D code went from 138 ns with the small array and the function to 58 ns with the large array and the lambda. And, the Python code expectantly got slower, even when I made sure to only test the np.mean function, the time taking the mean of the large array was 145 µs up from 10.5 µs with allocation and taking the mean with the smaller array.

So now the D version is 2474x faster.

Also, I was unable to get LDC numbers, as when I compiled my test program with all of the optimization flags, LDC returns 0 hnsecs

the code:

===============

import std.range;
import std.algorithm.iteration;
import std.experimental.ndslice;
import std.stdio;
import std.datetime;
import std.conv : to;

void f0() {
    auto means = 100_000.iota.sliced(100, 1000).transposed.map!(r => sum(r) / r.length);
}

void main() {
    auto r = benchmark!(f0)(10_000);
    auto f0Result = to!Duration(r[0]);
    f0Result.writeln;
}

I'm assuming that LLVM realizes that the variable means is never used, so it removes it from the final version.
December 30, 2015
On Wednesday, 30 December 2015 at 06:16:23 UTC, Jack Stouffer wrote:
> On Wednesday, 30 December 2015 at 00:24:38 UTC, Ilya Yaroshenko wrote:
>> [...]
>
> Thanks for the feedback. Good thing I posted this here before releasing it.
>
> [...]


means in your code is lazy variable :)
You may want to made means a global array. And copy mapped result to it. Please made PR to DlangSciencse/examples with your Python and D benchmarks. --Ilya
December 30, 2015
On Wednesday, 30 December 2015 at 01:03:39 UTC, Ilya Yaroshenko wrote:
> ldmd2/ldc2 flag -mcpu=native will optimise code for your CPU. -- Ilya

Hmm, ldc seems to segfault when passing that flag. I will make a bug report for this.
December 30, 2015
On Tuesday, 29 December 2015 at 18:08:52 UTC, Andrei Alexandrescu wrote:
> On 12/29/2015 11:28 AM, Robert burner Schadek wrote:
>> On Tuesday, 29 December 2015 at 16:11:00 UTC, Ilya Yaroshenko wrote:
>>>
>>> OK, lets discuss every function.
>>>
>>
>> That is acceptably the problem. It is not about the documentation of the
>> functions it is about the documentation binding the functions together
>> and the documentation giving the idea of the library.
>
> Hopefully this is something that you or someone else could help by creating pull requests. Any volunteers? -- Andrei

Does it means that the PR can be merged? --Ilya
December 30, 2015
On Wednesday, 30 December 2015 at 21:39:54 UTC, Ilya Yaroshenko wrote:
> On Tuesday, 29 December 2015 at 18:08:52 UTC, Andrei Alexandrescu wrote:
>> On 12/29/2015 11:28 AM, Robert burner Schadek wrote:
>>> On Tuesday, 29 December 2015 at 16:11:00 UTC, Ilya Yaroshenko wrote:
>>>>
>>>> OK, lets discuss every function.
>>>>
>>>
>>> That is acceptably the problem. It is not about the documentation of the
>>> functions it is about the documentation binding the functions together
>>> and the documentation giving the idea of the library.
>>
>> Hopefully this is something that you or someone else could help by creating pull requests. Any volunteers? -- Andrei
>
> Does it means that the PR can be merged? --Ilya

If there's a time constraint, perhaps we could merge it for 2.070 but keep adding documentation updates to both master and release branches?
December 30, 2015
On Wednesday, 30 December 2015 at 22:46:28 UTC, John Colvin wrote:
> On Wednesday, 30 December 2015 at 21:39:54 UTC, Ilya Yaroshenko wrote:
>> On Tuesday, 29 December 2015 at 18:08:52 UTC, Andrei Alexandrescu wrote:
>>> On 12/29/2015 11:28 AM, Robert burner Schadek wrote:
>>>> [...]
>>>
>>> Hopefully this is something that you or someone else could help by creating pull requests. Any volunteers? -- Andrei
>>
>> Does it means that the PR can be merged? --Ilya
>
> If there's a time constraint, perhaps we could merge it for 2.070 but keep adding documentation updates to both master and release branches?

2.070 would be merged into stable soon.
1 2 3 4 5 6 7
Next ›   Last »