What happened?
Commit a13a255#diff-c73f63e529ab4065cca1aa23d93c91a3b060f314e2e498b708b90fef87141a88 which attempts to fix some type hint issues also introduced a major performance regression in Coordinate.to_index() (mostly felt in to_dataframe()) by changing the code_list variable being cache-friendly ndarray to Python lists.
What did you expect to happen?
I expect this to be near instantaneous like it was in 2025.8.0 but now it takes close to 10s on my machine.
Minimal Complete Verifiable Example
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "xarray[complete]@git+https://github.com/pydata/xarray.git@main",
# ]
# ///
#
# This script automatically imports the development branch of xarray to check for issues.
# Please delete this header if you have _not_ tested this script with `uv run`!
import xarray as xr
xr.show_versions()
import numpy as np
import xarray as xr
da = xr.DataArray(np.arange(100 * 2000 * 300).reshape(100, 2000, 300), name="foo")
da.to_dataframe()
Steps to reproduce
No response
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment
Details
What happened?
Commit a13a255#diff-c73f63e529ab4065cca1aa23d93c91a3b060f314e2e498b708b90fef87141a88 which attempts to fix some type hint issues also introduced a major performance regression in
Coordinate.to_index()(mostly felt into_dataframe()) by changing thecode_listvariable being cache-friendly ndarray to Python lists.What did you expect to happen?
I expect this to be near instantaneous like it was in 2025.8.0 but now it takes close to 10s on my machine.
Minimal Complete Verifiable Example
Steps to reproduce
No response
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment
Details