Title: Improve speed in projections/geo.py by oscargus · Pull Request #22677 · matplotlib/matplotlib · GitHub
Open Graph Title: Improve speed in projections/geo.py by oscargus · Pull Request #22677 · matplotlib/matplotlib
X Title: Improve speed in projections/geo.py by oscargus · Pull Request #22677 · matplotlib/matplotlib
Description: PR Summary Stumbled upon some optimization opportunities while browsing the code. Removed redundant calls to sin/cos/sqrt. Replaced np.sqrt with power computation for constant scalars. Used np.cbrt. In [41]: %timeit np.sqrt(2.0) 1.16 µs ± 9.11 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) In [42]: %timeit math.sqrt(2.0) 77.1 ns ± 0.214 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each) PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there). Documentation is sphinx and numpydoc compliant (the docs should build without error).
Open Graph Description: PR Summary Stumbled upon some optimization opportunities while browsing the code. Removed redundant calls to sin/cos/sqrt. Replaced np.sqrt with power computation for constant scalars. Used np.cbrt...
X Description: PR Summary Stumbled upon some optimization opportunities while browsing the code. Removed redundant calls to sin/cos/sqrt. Replaced np.sqrt with power computation for constant scalars. Used np.cbrt...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/22677
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c0e26dc2-a9c1-5158-1274-8145452afbbc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B670:3FC474:7322CB:A5E30E:6A549299 |
| html-safe-nonce | 631a82a99146222a6f6734b475e3e0dde479224c6879148a8e782c991e9fbe7e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjcwOjNGQzQ3NDo3MzIyQ0I6QTVFMzBFOjZBNTQ5Mjk5IiwidmlzaXRvcl9pZCI6IjExODcxMTY2MDU3Nzc0MTY4NTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1b89db4aed9f8fbb69aa2ebda0a280b1a2c6de931a481caa9dab72577b086733 |
| hovercard-subject-tag | pull_request:884205319 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/22677/files |
| twitter:image | https://avatars.githubusercontent.com/u/8114497?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/8114497?s=400&v=4 |
| og:image:alt | PR Summary Stumbled upon some optimization opportunities while browsing the code. Removed redundant calls to sin/cos/sqrt. Replaced np.sqrt with power computation for constant scalars. Used np.cbrt... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width