pull_requests: 1099657449
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1099657449 | PR_kwDOAMm_X85Bi3Dp | 7221 | closed | 0 | Remove debugging slow assert statement | 90008 | We've been trying to understand why our code is slow. One part is that we use xarray.Datasets almost like dictionaries for our data. The following code is quite common for us ```python import xarray as xr dataset = xr.Dataset() dataset['a'] = 1 dataset['b'] = 2 ``` However, through benchmarks, it became obvious that the `merge_core` method of xarray was causing alot of slowdowns. `main` branch:  With this merge request:  ```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() 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, 50]) plt.grid(True) ``` - [ ] Closes #xxxx - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` | 2022-10-26T01:43:08Z | 2022-10-28T02:49:44Z | 2022-10-28T02:49:44Z | 2022-10-28T02:49:44Z | 040816a64f52974a79f631c55d920f4b6a4c22ec | 0 | 1a58759ea804775564a4e074e28444d0241e9f2a | c000690c7aa6dd134b45e580f377681a0de1996c | CONTRIBUTOR | 13221727 | https://github.com/pydata/xarray/pull/7221 |
Links from other tables
- 1 row from pull_requests_id in labels_pull_requests