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

MAINT: Large overhead in some random functions #15676

Merged
merged 3 commits into from Mar 2, 2020

Conversation

charris
Copy link
Member

@charris charris commented Mar 1, 2020

Backport of #15511.

Fixes #15460

  • slow calls to np.dtype.name replaced with np.dtype,
  • mtrand.pyx and _generator.pyx updated
  • test _test_warns_byteorder_ updated

slow calls to np.dtype.name replaced with np.dtype,
mtrand.pyx and _generator.pyx updated,
test test_warns_byteorder updated

before:
%timeit rs.random(): 520 ns ± 33.1 ns per loop
%timeit rg.random(): 6.36 µs ± 222 ns per loop

after:
%timeit rs.random(): 453 ns ± 6.95 ns per loop
%timeit rg.random(): 594 ns ± 9.66 ns per loop
@charris charris added this to the 1.18.2 release milestone Mar 1, 2020
@charris charris closed this Mar 2, 2020
@charris charris reopened this Mar 2, 2020
@charris charris merged commit 50c93b8 into numpy:maintenance/1.18.x Mar 2, 2020
@charris charris deleted the backport-15511 branch March 2, 2020 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants