Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2017-01-08 Thread Joseph Rushton Wakeling via Digitalmars-d
On Sunday, 8 January 2017 at 13:16:29 UTC, Joseph Rushton Wakeling wrote: I'm asking for eyes on the problem because reducing it to a minimal example appears non-trivial, while the bug itself looks serious beyond its effect on this PR. I underestimated myself :-P Minimal example is as follows

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2017-01-08 Thread Joseph Rushton Wakeling via Digitalmars-d
On Sunday, 8 January 2017 at 02:51:51 UTC, Andrei Alexandrescu wrote: This indicates a compiler bug in dmd itself, so the best outcome for this library work would be a reduced compiler bug + a simple library workaround. -- Andrei Yes, that much is clear -- sorry if I wasn't clear enough myself

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2017-01-07 Thread Andrei Alexandrescu via Digitalmars-d
On 1/7/17 6:16 PM, Joseph Rushton Wakeling wrote: The method I developed works fine with LDC, but fails with DMD: the internal state of the generator winds up as all zeros, except for the `State.z` parameter which mysteriously ends up at the correct value. This would suggest that somehow the gen

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2017-01-07 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: On 11/26/16 11:31 AM, Ilya Yaroshenko wrote: Hey, 32-bit Mt19937 random number Generator is default in Phobos. It is default in Mir too, except that 64-bit targets use 64-bit Mt19937 instead. Congrats! Also thanks for

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-14 Thread Ilya Yaroshenko via Digitalmars-d
On Wednesday, 14 December 2016 at 00:18:06 UTC, Joseph Rushton Wakeling wrote: Cool. Last question: IIUC you use the private `_z` parameter as a cache for the most recent `data[index]` value (and AFAICT that's the only use it has). Is there a good reason for doing this, rather than just setti

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-14 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 26 November 2016 at 16:31:40 UTC, Ilya Yaroshenko wrote: 1. Improve RNG generation performance by making code more friendly for CPU pipelining. Tempering (finalization) operations was mixed with internal payload update operations. A note on this. The `opCall` (or, in the range ve

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-13 Thread Joseph Rushton Wakeling via Digitalmars-d
On Tuesday, 13 December 2016 at 23:18:26 UTC, Ilya Yaroshenko wrote: * @Ilya, is this implementation your own design, or do you have a reference for the rationale behind this revised implementation of MT? My own. Congratulations, then -- I think this is a very interesting rewrite of t

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-13 Thread Ilya Yaroshenko via Digitalmars-d
If I remember correctly it is used with Using, so I use the same type. Using -> Uint Sorry, it is phone keyboard

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-13 Thread Ilya Yaroshenko via Digitalmars-d
On Tuesday, 13 December 2016 at 18:15:25 UTC, Joseph Rushton Wakeling wrote: On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Congrats! Also thanks for using the Boost license which would allow backporting the improvements to Phobos. Who'd be up for it? I've finally f

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-13 Thread Joseph Rushton Wakeling via Digitalmars-d
On Tuesday, 13 December 2016 at 18:15:25 UTC, Joseph Rushton Wakeling wrote: I'm going to try to put together a range-based version to see if this also makes any difference. I'll post some benchmarks of my own once that's done, and if all looks good I'll try to put a Phobos PR together. Benc

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-12-13 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Congrats! Also thanks for using the Boost license which would allow backporting the improvements to Phobos. Who'd be up for it? I've finally found a moment to look into this (I'm at home recovering from a seasonal virus

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-29 Thread Ilya Yaroshenko via Digitalmars-d
On Tuesday, 29 November 2016 at 16:54:55 UTC, Nordlöw wrote: On Saturday, 26 November 2016 at 16:31:40 UTC, Ilya Yaroshenko wrote: Bench results: mir.random 32-bit Mt19937: 6.80851 Gb/s Does Gb mean Gigabytes or Gigabits? Gigabits

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-29 Thread Nordlöw via Digitalmars-d
On Saturday, 26 November 2016 at 16:31:40 UTC, Ilya Yaroshenko wrote: Bench results: mir.random 32-bit Mt19937: 6.80851 Gb/s Does Gb mean Gigabytes or Gigabits?

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-28 Thread Steven Schveighoffer via Digitalmars-d
On 11/27/16 8:58 AM, Guillaume Piolat wrote: On Sunday, 27 November 2016 at 13:35:48 UTC, Andrei Alexandrescu wrote: A useful intermediate step is to have these "[shared] static this" ctor call a function instead, so that programs without druntime can call them too. That would be progress.

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-28 Thread Jacob Carlborg via Digitalmars-d
On 2016-11-27 14:28, Guillaume Piolat wrote: Without druntime, global ctor/dtor and TLS can't be used too. Isn't TLS initialized by the OS? -- /Jacob Carlborg

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread jmh530 via Digitalmars-d
On Sunday, 27 November 2016 at 06:46:20 UTC, Ilya Yaroshenko wrote: LAPACK API will be a part of Mir GLAS https://github.com/libmir/mir-glas --Ilya Great. I might have asked before, apologies if so.

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 27 November 2016 at 13:58:29 UTC, Guillaume Piolat wrote: On Sunday, 27 November 2016 at 13:35:48 UTC, Andrei Alexandrescu wrote: A useful intermediate step is to have these "[shared] static this" ctor call a function instead, so that programs without druntime can call them too.

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Guillaume Piolat via Digitalmars-d
On Sunday, 27 November 2016 at 13:35:48 UTC, Andrei Alexandrescu wrote: A useful intermediate step is to have these "[shared] static this" ctor call a function instead, so that programs without druntime can call them too. That would be progress. Andrei Same story for core.cpuid which is

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Andrei Alexandrescu via Digitalmars-d
On 11/27/2016 08:28 AM, Guillaume Piolat wrote: On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Congrats! Also thanks for using the Boost license which would allow backporting the improvements to Phobos. Who'd be up for it? Also I'm thinking of removing std.random's d

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Guillaume Piolat via Digitalmars-d
On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Congrats! Also thanks for using the Boost license which would allow backporting the improvements to Phobos. Who'd be up for it? Also I'm thinking of removing std.random's dependency on druntime, e.g. by removing the u

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-26 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 27 November 2016 at 02:28:06 UTC, jmh530 wrote: On Saturday, 26 November 2016 at 16:31:40 UTC, Ilya Yaroshenko wrote: https://github.com/libmir : - mir - Generic numeric library - dcv - D Computer Vision library - mir-glas - Linear Algebra Subprograms (written in D) - mir-random

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-26 Thread jmh530 via Digitalmars-d
On Saturday, 26 November 2016 at 16:31:40 UTC, Ilya Yaroshenko wrote: https://github.com/libmir : - mir - Generic numeric library - dcv - D Computer Vision library - mir-glas - Linear Algebra Subprograms (written in D) - mir-random - random numbers generators, includes non-uniform distribu

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-26 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Also I'm thinking of removing std.random's dependency on druntime, e.g. by removing the uses of enforce. Thoughts? There's no strong reason for those checks to be done via `enforce` except for a design decision that user

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-26 Thread Ilya Yaroshenko via Digitalmars-d
On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: On 11/26/16 11:31 AM, Ilya Yaroshenko wrote: Hey, 32-bit Mt19937 random number Generator is default in Phobos. It is default in Mir too, except that 64-bit targets use 64-bit Mt19937 instead. The last Mir Random beta i

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-26 Thread Andrei Alexandrescu via Digitalmars-d
On 11/26/16 11:31 AM, Ilya Yaroshenko wrote: Hey, 32-bit Mt19937 random number Generator is default in Phobos. It is default in Mir too, except that 64-bit targets use 64-bit Mt19937 instead. The last Mir Random beta improves performance for Mt19937. The goal was to: Congrats! Also thanks fo