Great. It seems like there's some low hanging fruit to speed it up even more :)
On Tue, Sep 13, 2016 at 2:35 PM, Neal Becker <ndbeck...@gmail.com> wrote: > Stefan Karpinski wrote: > > > On Tue, Sep 13, 2016 at 1:23 PM, Neal Becker > > <ndbeck...@gmail.com> wrote: > > > >> > >> Thanks for the ideas. Here, though, the generated values need to be > >> Uniform([0...2^N]), where N could be any number. For example [0...2^3]. > >> So the output array itself would be Array{Int64} for example, but the > >> values > >> in the array are [0 ... 7]. Do you know a better way to do this? > > > > > > Is this the kind of thing you're looking for? > > > > julia> @time rand(0x0:0x7, 10^5); > > 0.001795 seconds (10 allocations: 97.953 KB) > > > > > > Produces a 10^5-element array of random UInt8 values between 0 and 7. > > Yes, that is the sort of thing I want! I guess the type of the returned > array is determined by the type of the argument passed. > > BTW, after the first fix to my PnGen, the time for the julia code is about > equal to the python/c++ code. Not bad I suppose for a 1st try, although > this code is pretty trivial. > > >