Skip to content
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

convert(Matrix, x') is very slow #412

Open
gdkrmr opened this issue Jul 9, 2024 · 0 comments
Open

convert(Matrix, x') is very slow #412

gdkrmr opened this issue Jul 9, 2024 · 0 comments

Comments

@gdkrmr
Copy link
Contributor

gdkrmr commented Jul 9, 2024

convert(Matrix, x') is so slow that I haven't gotten it to finish. convert(Matrix, x) works just fine.

julia> using YAXArrays, Zarr

julia> path = "~/data/DataCube/v3.0.2/esdc-8d-0.25deg-1x720x1440-3.0.2.zarr"
"~/data/DataCube/v3.0.2/esdc-8d-0.25deg-1x720x1440-3.0.2.zarr"

julia> ds = open_dataset(path)
YAXArray Dataset
Shared Axes: 
 lon Sampled{Float64} -179.875:0.25:179.875 ForwardOrdered Regular Points,
 lat Sampled{Float64} -89.875:0.25:89.875 ForwardOrdered Regular Points,
↗ Ti  Sampled{DateTime} [1979-01-05T00:00:00, , 2021-12-31T00:00:00] ForwardOrdered Irregular Points
Variables: 
....


julia> mat = ds.air_temperature_2m[Ti = 1000]
╭──────────────────────────────╮
│ 1440×720 YAXArray{Float32,2} │
├──────────────────────────────┴──────────────────────────────────────── dims ┐
   lon Sampled{Float64} -179.875:0.25:179.875 ForwardOrdered Regular Points,
   lat Sampled{Float64} -89.875:0.25:89.875 ForwardOrdered Regular Points
├──────────────────────────────────────────────────────
....

julia> @time convert(Matrix{Float32}, mat)
  1.809297 seconds (5.15 M allocations: 362.756 MiB, 5.92% gc time, 98.13% compilation time)
...

julia> @time convert(Matrix{Float32}, mat')

# has to be interrupted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant