Calling functions which iterate over array elements (e.g. Statistics.mean) on netcdf datasets can be very slow. It would be useful to have some performance tips to e.g. first convert a dataset to an Array.
On that note, I noticed that simply calling Array(dataset) is also slow. I take it from the examples in the manual that the suggested way to convert is to call dataset[:]. However this has different behaviour from ordinary Julia multidimensional arrays, which return a vector:
julia> X = rand(3,3);
julia> X[:]
9-element Array{Float64,1}:
0.1443316789104081
0.8768272466421989
0.01240381950170022
0.6732249425627772
0.4128628021781906
0.2112718766221251
0.9459472658879167
0.8996044010964837
0.47806340748050236
Calling functions which iterate over array elements (e.g.
Statistics.mean) on netcdf datasets can be very slow. It would be useful to have some performance tips to e.g. first convert a dataset to anArray.On that note, I noticed that simply calling
Array(dataset)is also slow. I take it from the examples in the manual that the suggested way to convert is to calldataset[:]. However this has different behaviour from ordinary Julia multidimensional arrays, which return a vector: