Re: Speed of Random Numbers

2019-08-04 Thread Daniel Kozak via Digitalmars-d-learn
On Sun, Aug 4, 2019 at 11:49 AM Daniel Kozak wrote: > > You can try http://code.dlang.org/packages/mir-random > > I am using theme here: > https://github.com/TechEmpower/FrameworkBenchmarks/blob/b9cc153dcd1c20e78197b0191536f0d11b8ca554/frameworks/D/vibed/source/postgresql.d#L49 > > On Sun, Aug 4,

Re: Speed of Random Numbers

2019-08-04 Thread Daniel Kozak via Digitalmars-d-learn
You can try http://code.dlang.org/packages/mir-random I am using theme here: https://github.com/TechEmpower/FrameworkBenchmarks/blob/b9cc153dcd1c20e78197b0191536f0d11b8ca554/frameworks/D/vibed/source/postgresql.d#L49 On Sun, Aug 4, 2019 at 12:20 AM Giovanni Di Maria via Digitalmars-d-learn

Re: Speed of Random Numbers

2019-08-03 Thread Giovanni Di Maria via Digitalmars-d-learn
Thank you very much to Everybody! Giovanni

Re: Speed of Random Numbers

2019-08-03 Thread matheus via Digitalmars-d-learn
On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: For me the "goodness of random" is NOT important. If that's the case, you could roll your own RNG: //DMD64 D Compiler 2.072.2 import std.stdio; import std.datetime; import std.array, std.random; void main(){ ubyte x;

Re: Speed of Random Numbers

2019-08-03 Thread bauss via Digitalmars-d-learn
On Saturday, 3 August 2019 at 17:47:46 UTC, Giovanni Di Maria wrote: On Saturday, 3 August 2019 at 17:44:44 UTC, lithium iodate wrote: On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: [...] First off you could try to use a faster RNG engine than the default. The easiest

Re: Speed of Random Numbers

2019-08-03 Thread Dennis via Digitalmars-d-learn
On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: Do you know other faster functions or methods to generate random numbers? For me the "goodness of random" is NOT important. I found some nice random functions in this public-domain C single-header library collection, one

Re: Speed of Random Numbers

2019-08-03 Thread Giovanni Di Maria via Digitalmars-d-learn
On Saturday, 3 August 2019 at 17:44:44 UTC, lithium iodate wrote: On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: [...] First off you could try to use a faster RNG engine than the default. The easiest way is to define a variable containing it and passing it to the

Re: Speed of Random Numbers

2019-08-03 Thread lithium iodate via Digitalmars-d-learn
On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: Do you know other faster functions or methods to generate random numbers? For me the "goodness of random" is NOT important. Thank you very much GIovanni Di Maria First off you could try to use a faster RNG engine than the

Re: Speed of Random Numbers

2019-08-03 Thread Giovanni Di Maria via Digitalmars-d-learn
On Saturday, 3 August 2019 at 17:17:23 UTC, Cym13 wrote: On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: [...] To what extent isn't the quality of randomness important to you? Your posts reminds me of the way Doom (the original) did it for things like enemy behaviour

Re: Speed of Random Numbers

2019-08-03 Thread Cym13 via Digitalmars-d-learn
On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria wrote: Hi to everybody I am doing some experiments about random numbers. I need "extreme speed" for the generation for numbers from 1 to 8. Generating 500_000_000 numbers with this code: - import

Speed of Random Numbers

2019-08-03 Thread Giovanni Di Maria via Digitalmars-d-learn
Hi to everybody I am doing some experiments about random numbers. I need "extreme speed" for the generation for numbers from 1 to 8. Generating 500_000_000 numbers with this code: - import std.stdio, std.array, std.random; void main() { byte c;