issues: 1423321834
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1423321834 | PR_kwDOAMm_X85Bi5BN | 7222 | Actually make the fast code path return early for Aligner.align | 90008 | closed | 0 | 6 | 2022-10-26T01:59:09Z | 2022-10-28T16:22:36Z | 2022-10-28T16:22:35Z | CONTRIBUTOR | 0 | pydata/xarray/pulls/7222 | In relation to my other PR. Without this PR
With the early return
Removing the frivolous copy (does not pass tests)Code for benchmark```python from tqdm import tqdm import xarray as xr from time import perf_counter import numpy as np N = 1000 # Everybody is lazy loading now, so lets force modules to get instantiated dummy_dataset = xr.Dataset() dummy_dataset['a'] = 1 dummy_dataset['b'] = 1 del dummy_dataset time_elapsed = np.zeros(N) dataset = xr.Dataset() # tqdm = iter for i in tqdm(range(N)): time_start = perf_counter() dataset[f"var{i}"] = i time_end = perf_counter() time_elapsed[i] = time_end - time_start # %% from matplotlib import pyplot as plt plt.plot(np.arange(N), time_elapsed * 1E3, label='Time to add one variable') plt.xlabel("Number of existing variables") plt.ylabel("Time to add a variables (ms)") plt.ylim([0, 10]) plt.grid(True) ```xref: https://github.com/pydata/xarray/pull/7221
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7222/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | pull |