Skip to content

Conversation

@mroeschke
Copy link
Member

Just to be polite.

@mroeschke mroeschke added this to the 3.0 milestone Nov 7, 2025
@mroeschke mroeschke added the Refactor Internal refactoring of code label Nov 7, 2025
@jbrockmendel
Copy link
Member

Does this affect anything? IIUC releasing and reacquiring is not zero-cost

@mroeschke
Copy link
Member Author

mroeschke commented Nov 8, 2025

Does this affect anything? IIUC releasing and reacquiring is not zero-cost

Minor help for users that want to multi-threading things with pandas (e.g. Dask). Other helper functions in this file release the gil if possible. It appears there's some overhead; in this worst case with small data

In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: arr = np.array([0, 1])

In [4]: %timeit pd._libs.lib.is_range_indexer(arr, 2)
503 ns ± 2.63 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)  # PR
466 ns ± 7.35 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)  # main

@jbrockmendel jbrockmendel merged commit 4a417cf into pandas-dev:main Nov 8, 2025
45 of 46 checks passed
@jbrockmendel
Copy link
Member

Thanks @mroeschke

@mroeschke mroeschke deleted the ref/nogil branch November 8, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Internal refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants