Title: Refactor of `axis.py`/ticking should have large performance gains · Issue #5665 · matplotlib/matplotlib · GitHub
Open Graph Title: Refactor of `axis.py`/ticking should have large performance gains · Issue #5665 · matplotlib/matplotlib
X Title: Refactor of `axis.py`/ticking should have large performance gains · Issue #5665 · matplotlib/matplotlib
Description: Right now, each Axis has a two lists of Tick objects (one major, one minor), each of which has 3 Line objects (for left tick, right tick and gridline) and 2 Text objects (for main and secondary label). Constructing Line objects is rather...
Open Graph Description: Right now, each Axis has a two lists of Tick objects (one major, one minor), each of which has 3 Line objects (for left tick, right tick and gridline) and 2 Text objects (for main and secondary lab...
X Description: Right now, each Axis has a two lists of Tick objects (one major, one minor), each of which has 3 Line objects (for left tick, right tick and gridline) and 2 Text objects (for main and secondary lab...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/5665
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Refactor of `axis.py`/ticking should have large performance gains","articleBody":"Right now, each `Axis` has a two lists of `Tick` objects (one major, one minor), each of which has 3 `Line` objects (for left tick, right tick and gridline) and 2 `Text` objects (for main and secondary label). Constructing `Line` objects is rather heavy and expensive. Refactoring this code so that each `Axis` had 3 `LineCollection` objects instead where only the points of the ticks needs to be updated, sharing all of the line style information, should be _much_ faster.\n\nOn the following simple benchmark:\n\n```\nplt.subplots(8, 8)\nplt.savefig('test.png')\n```\n\n25% of the time is spent constructing the `Line` objects. The suggested change above should reduce the number of `Line` objects from 3*N (where N is the number of ticks, usually a dozen or so) to 3.\n","author":{"url":"https://github.com/mdboom","@type":"Person","name":"mdboom"},"datePublished":"2015-12-11T22:39:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":29},"url":"https://github.com/5665/matplotlib/issues/5665"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:664b13c6-4a4b-79aa-4f8b-6794f962ef5d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2A8:69D3C:13901B:19D89F:6A5162E7 |
| html-safe-nonce | 9bb757de666a943a2842ba0c8b63927fc53268247ab6824dbcf0043f6da88852 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkE4OjY5RDNDOjEzOTAxQjoxOUQ4OUY6NkE1MTYyRTciLCJ2aXNpdG9yX2lkIjoiMjU4NDI3NDMyMDQ3OTA1MjUxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | af05b945a6bec8c8b739a2b900b5382ab554b4ae752d7e13d347cb7eeed7671d |
| hovercard-subject-tag | issue:121806051 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/matplotlib/matplotlib/5665/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5f0feeaa124a13ad533f517421357ad166526ba5adb2bf7045877dad6e84b8d2/matplotlib/matplotlib/issues/5665 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5f0feeaa124a13ad533f517421357ad166526ba5adb2bf7045877dad6e84b8d2/matplotlib/matplotlib/issues/5665 |
| og:image:alt | Right now, each Axis has a two lists of Tick objects (one major, one minor), each of which has 3 Line objects (for left tick, right tick and gridline) and 2 Text objects (for main and secondary lab... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mdboom |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2eeb434949a926fad21064b4d395a54759f7a0b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width