{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5665","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5665/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5665/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5665/events","html_url":"https://github.com/matplotlib/matplotlib/issues/5665","id":121806051,"number":5665,"title":"Refactor of `axis.py`/ticking should have large performance gains","user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/Difficulty:%20Medium","name":"Difficulty: Medium","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-11T22:39:18Z","updated_at":"2015-12-11T23:50:41Z","closed_at":null,"body":"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.\r\n\r\nOn the following simple benchmark:\r\n\r\n```\r\nplt.subplots(8, 8)\r\nplt.savefig('test.png')\r\n```\r\n\r\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."},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/164083153","html_url":"https://github.com/matplotlib/matplotlib/issues/5665#issuecomment-164083153","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5665","id":164083153,"user":{"login":"Tillsten","id":189880,"avatar_url":"https://avatars.githubusercontent.com/u/189880?v=3","gravatar_id":"","url":"https://api.github.com/users/Tillsten","html_url":"https://github.com/Tillsten","followers_url":"https://api.github.com/users/Tillsten/followers","following_url":"https://api.github.com/users/Tillsten/following{/other_user}","gists_url":"https://api.github.com/users/Tillsten/gists{/gist_id}","starred_url":"https://api.github.com/users/Tillsten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tillsten/subscriptions","organizations_url":"https://api.github.com/users/Tillsten/orgs","repos_url":"https://api.github.com/users/Tillsten/repos","events_url":"https://api.github.com/users/Tillsten/events{/privacy}","received_events_url":"https://api.github.com/users/Tillsten/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T23:50:41Z","updated_at":"2015-12-11T23:50:41Z","body":"I think i have a prototype doing that, if no one works on this before i will have a look after christmas. The whole axis code seems quite convoluted for what it does.\r\n"}}