{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/6733","labels_url":"https://api.github.com/repos/atom/atom/issues/6733/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/6733/comments","events_url":"https://api.github.com/repos/atom/atom/issues/6733/events","html_url":"https://github.com/atom/atom/pull/6733","id":75141748,"number":6733,"title":"Render lines via tiles","user":{"login":"as-cii","id":482957,"avatar_url":"https://avatars.githubusercontent.com/u/482957?v=3","gravatar_id":"","url":"https://api.github.com/users/as-cii","html_url":"https://github.com/as-cii","followers_url":"https://api.github.com/users/as-cii/followers","following_url":"https://api.github.com/users/as-cii/following{/other_user}","gists_url":"https://api.github.com/users/as-cii/gists{/gist_id}","starred_url":"https://api.github.com/users/as-cii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/as-cii/subscriptions","organizations_url":"https://api.github.com/users/as-cii/orgs","repos_url":"https://api.github.com/users/as-cii/repos","events_url":"https://api.github.com/users/as-cii/events{/privacy}","received_events_url":"https://api.github.com/users/as-cii/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":38,"created_at":"2015-05-11T08:50:00Z","updated_at":"2015-06-10T16:41:16Z","closed_at":"2015-06-02T22:18:42Z","pull_request":{"url":"https://api.github.com/repos/atom/atom/pulls/6733","html_url":"https://github.com/atom/atom/pull/6733","diff_url":"https://github.com/atom/atom/pull/6733.diff","patch_url":"https://github.com/atom/atom/pull/6733.patch"},"body":"This PR introduces a change in how we render lines. It does so by organizing them into tiles, which we then move up and down through a compositing transformation. The main advantage is that paint times dramatically reduce, because now we simply need to paint a small tile, instead of all the lines. This is especially noticeable during scrolling which, as a result, will be the subject of the benchmarks I am going to show later on.\r\n\r\nPlease, note that:\r\n\r\n* [x] Specs are broken. The solution you can see here was achieved by spiking a bunch of ideas, and therefore I didn't pay attention to change specs/code gradually. As a result, I plan to adapt previous specs and write some new ones as soon as possible.\r\n* [x] There's some evident structural duplication in code. However, I'd like to start refactoring that stuff as soon as I have unit tests to prevent naive errors.\r\n* [x] Naming-wise I am not entirely happy with `TilesPresenter` and `LinesPresenter` and they're probably going to change. Any suggestion or improvement is very welcome here.\r\n* I have intentionally left out line numbers from using this new approach. I'd like to keep this PR focused and work on that right after :ship:ping this one.\r\n\r\n:racehorse: And now some benchmarks! :racehorse:\r\n\r\n## Benchmarks\r\nTests conducted using:\r\n\r\n* A `1920x1080` window\r\n* `editor.scrollSensitivity = 130`\r\n* A custom code (associated to a keyboard key) to simulate `mouseWheel` events\r\n\r\n  ```coffee\r\n  document.querySelector(\"html /deep/ .editor-contents--private\").dispatchEvent(new WheelEvent(\"mousewheel\", wheelDeltaY: -250))\r\n  ```\r\n* Keyboard Key Repeat: `Fast` (Mac OS X setting)\r\n* Delay Until Repeat: `Short` (Mac OS X setting)\r\n\r\nI needed a (more or less) repeatable way to benchmark scrolling. To try this out, you can simply scroll up and down as you would normally do.\r\n\r\n### master\r\n![master](https://cloud.githubusercontent.com/assets/482957/7561220/9eec5f12-f7ca-11e4-82ba-ac2124b536f0.png)\r\n\r\n### as-tiled-rendering\r\n![as-tiled-rendering](https://cloud.githubusercontent.com/assets/482957/7561218/9a2fd81e-f7ca-11e4-8194-4075bc541ea3.png)\r\n\r\n### Why this matters?\r\nAs you can notice, paint times are dramatically reduced. This may not be noticeable with your :eyes:, but it's nevertheless important 'cause it leaves some room for additional operations (such as a more expensive character measurement computation). As said earlier, things are going to speed up further once we introduce tiling for line numbers as well.\r\n\r\nIt would be great if you could try this out, reporting any eventual regression or glitch that I may have overlooked while implementing the tiling strategy. Moreover, any code review or additional :eyes: are always welcome.\r\n\r\nThank you!\r\n\r\n/cc: @atom/feedback @nathansobo\r\n"},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/110827340","html_url":"https://github.com/atom/atom/pull/6733#issuecomment-110827340","issue_url":"https://api.github.com/repos/atom/atom/issues/6733","id":110827340,"user":{"login":"mehcode","id":753919,"avatar_url":"https://avatars.githubusercontent.com/u/753919?v=3","gravatar_id":"","url":"https://api.github.com/users/mehcode","html_url":"https://github.com/mehcode","followers_url":"https://api.github.com/users/mehcode/followers","following_url":"https://api.github.com/users/mehcode/following{/other_user}","gists_url":"https://api.github.com/users/mehcode/gists{/gist_id}","starred_url":"https://api.github.com/users/mehcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehcode/subscriptions","organizations_url":"https://api.github.com/users/mehcode/orgs","repos_url":"https://api.github.com/users/mehcode/repos","events_url":"https://api.github.com/users/mehcode/events{/privacy}","received_events_url":"https://api.github.com/users/mehcode/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T16:41:16Z","updated_at":"2015-06-10T16:41:16Z","body":"@v3ss0n From what I understand atom has a packaged version. The version you have is only used to bootstrap the process."}}