Skip to content

Commit

Permalink
Update performance.md
Browse files Browse the repository at this point in the history
Added a note saying that load! is not exported
  • Loading branch information
aramirezreyes committed Nov 14, 2020
1 parent 947db89 commit 389434a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ temp = nctemp[:,:] :: Array{Float64,2}
close(ds)
```

Alternatively, one can also use so called "[function barriers](https://docs.julialang.org/en/v1/manual/performance-tips/index.html#kernel-functions-1)" or the in-place `load!` function:
Alternatively, one can also use so called "[function barriers](https://docs.julialang.org/en/v1/manual/performance-tips/index.html#kernel-functions-1)" or the in-place `NCDatasets.load!` function (which is unexported, so it has to be prefixed with the module name):

```julia
ds = NCDataset("file.nc")

temp = zeros(10,20)
load!(ds["temp"],temp,:,:)
NCDatasets.load!(ds["temp"],temp,:,:)
```

* Most julia functions (like `mean`, `sum`,... from the module Statistics) access an array element-wise. It is generally much faster to load the data in memory (if possible) to make the computation.
Expand Down

0 comments on commit 389434a

Please sign in to comment.