Title: Speed-up math.dist() by 30% by rhettinger · Pull Request #9628 · python/cpython · GitHub
Open Graph Title: Speed-up math.dist() by 30% by rhettinger · Pull Request #9628 · python/cpython
X Title: Speed-up math.dist() by 30% by rhettinger · Pull Request #9628 · python/cpython
Description: Manual type checking is much faster than the argument clinic equivalent. --------- baseline ------------ $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2.5)' 'dist(p, q)' 5000000 loops, best of 11: 95.5 nsec per loop $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2.5)' 'dist(p, q)' 5000000 loops, best of 11: 95.3 nsec per loop $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2.5)' 'dist(p, q)' 5000000 loops, best of 11: 95.5 nsec per loop ------ patched ------ $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2.5)' 'dist(p, q)' 5000000 loops, best of 11: 67 nsec per loop $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2.5)' 'dist(p, q)' 5000000 loops, best of 11: 67.2 nsec per loop $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2.5)' 'dist(p, q)' 5000000 loops, best of 11: 67.3 nsec per loop
Open Graph Description: Manual type checking is much faster than the argument clinic equivalent. --------- baseline ------------ $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2...
X Description: Manual type checking is much faster than the argument clinic equivalent. --------- baseline ------------ $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -...
Opengraph URL: https://github.com/python/cpython/pull/9628
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:babcb38d-053b-3ba5-a0ad-48c3b6a94e4e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9644:3367C0:E593B6:14D376B:6A54C2F8 |
| html-safe-nonce | 44251e06509a7b124e954df925a04e1de1832c283b3628aab4bb88702ce0f494 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjQ0OjMzNjdDMDpFNTkzQjY6MTREMzc2Qjo2QTU0QzJGOCIsInZpc2l0b3JfaWQiOiIyNDI1OTMyMjQ2NTA4OTQ2MTY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e70af7b8184912a521b4ec54f16b7686255b03449bfcfc21832ddb43ff9857c0 |
| hovercard-subject-tag | pull_request:219077444 |
| 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/python/cpython/pull/9628/files |
| twitter:image | https://avatars.githubusercontent.com/u/1623689?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1623689?s=400&v=4 |
| og:image:alt | Manual type checking is much faster than the argument clinic equivalent. --------- baseline ------------ $ pytime -r11 -s 'from math import dist' -s 'p=(1.1, 2.2)' -s 'q=(1.5, 2... |
| 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/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 69f9664dd5e7a82ba8ab1b4cb7f5a2f09333ab38 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width