In [1]:
using PairwiseListMatrices
using Benchmarks
using Base.Test


WARNING: UUID.jl is deprecated, please use Base.Random.uuid1(), Base.Random.uuid4(), and Base.Random.UUID instead.

In [2]:
la = PairwiseListMatrix(collect(1:Int(100*99*0.5)));

In [3]:
ll = PairwiseListMatrix{Int64,Any,false}[ones(la) for i in 1:100 ];

In [4]:
l = ones(Int, 100, 100, 100);

In [5]:
@test all(std(l, 3) .== std(ll))

In [6]:
@benchmark std(l,3)


Out[6]:
================ Benchmark Results ========================
     Time per evaluation: 6.62 ms [6.53 ms, 6.72 ms]
Proportion of time in GC: 0.00% [0.00%, 0.00%]
        Memory allocated: 157.34 kb
   Number of allocations: 21 allocations
       Number of samples: 100
   Number of evaluations: 100
 Time spent benchmarking: 1.16 s

In [7]:
@benchmark std(ll)


Out[7]:
================ Benchmark Results ========================
     Time per evaluation: 4.12 ms [3.81 ms, 4.43 ms]
Proportion of time in GC: 0.55% [0.00%, 3.86%]
        Memory allocated: 200.52 kb
   Number of allocations: 53 allocations
       Number of samples: 100
   Number of evaluations: 100
 Time spent benchmarking: 0.50 s