-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crazy number of allocations on file read #273
Comments
How many allocations do you get when you run it twice (to make sure that we exclude the allocation of the julia compiler)? ds = NCDataset(path)
@time ds["hu"][:,:,1:20];
@time ds["hu"][:,:,1:20]; See also #251 (comment) |
What I posted was without compilation julia> @time ds["hu"][:,:,1:20];
4.510533 seconds (11.76 M allocations: 404.837 MiB, 5.94% gc time, 69.71% compilation time)
julia> @time ds["hu"][:,:,1:20];
1.865391 seconds (8.29 M allocations: 182.748 MiB, 13.99% gc time) |
Is it possible that this has to do with how missing values are handled. This is much faster as the documentation suggests. A = Array{Float32, 3}(undef, 705, 465, 20);
@time NCDatasets.load!(variable(ds,"hu"),A,:,:,1:20); But this never calls |
Okay I think I figured it out. If I remove the |
Good catch! |
Thanks again! Fixed via JuliaGeo/CommonDataModel.jl#29 |
I'm trying to read the E-OBS weather dataset and reading in the data is extremely slow and generates millions of allocations.
For this file I am getting:
0.800117 seconds (8.29 M allocations: 182.748 MiB, 26.05% gc time)
There seems to be some type instability in
CFtransformdata!
in CommonDataModel, but justnc_get_vars!
also takes half the time.This is on NCDatasets 0.14.6 and CommonDataModel 0.3.7
The text was updated successfully, but these errors were encountered: