{"action":"created","issue":{"url":"https://api.github.com/repos/Khan/aphrodite/issues/216","repository_url":"https://api.github.com/repos/Khan/aphrodite","labels_url":"https://api.github.com/repos/Khan/aphrodite/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/Khan/aphrodite/issues/216/comments","events_url":"https://api.github.com/repos/Khan/aphrodite/issues/216/events","html_url":"https://github.com/Khan/aphrodite/pull/216","id":213442507,"number":216,"title":"Optimize css()","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars0.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-03-10T20:21:27Z","updated_at":"2017-04-13T11:02:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Khan/aphrodite/pulls/216","html_url":"https://github.com/Khan/aphrodite/pull/216","diff_url":"https://github.com/Khan/aphrodite/pull/216.diff","patch_url":"https://github.com/Khan/aphrodite/pull/216.patch"},"body":"After the 1.2.0 release, I noticed that most of my optimizations were\r\ncompletely offset by the ordering bugfixes that were added. After some\r\nprofiling, I noticed that generateCSSRuleset was ripe for optimization.\r\n\r\nMy approach here is to reduce the amount of work that needs to be done\r\nto a bare minimum. I accomplish this by being smarter about when to loop\r\nand how many loops to run. In my benchmark, this PR reduces the runtime\r\nof css() from 2750 ms to 900 ms, which is 3.05x faster.\r\n\r\nSome of this performance improvement will only be seen when running on the client,\r\nbut on the server this should still result in ~2x faster improvement.\r\n\r\nThis is probably best reviewed commit-by-commit.\r\n\r\nBefore:\r\n\r\n<img width=\"810\" alt=\"screen shot 2017-03-21 at 2 31 50 pm\" src=\"https://cloud.githubusercontent.com/assets/195534/24171826/363b7566-0e43-11e7-8300-2859c7c03e58.png\">\r\n\r\nAfter:\r\n\r\n<img width=\"809\" alt=\"screen shot 2017-03-21 at 2 31 26 pm\" src=\"https://cloud.githubusercontent.com/assets/195534/24171839/3b5eff90-0e43-11e7-80cc-c209bf99bff3.png\">\r\n\r\n\r\n@xymostech "},"comment":{"url":"https://api.github.com/repos/Khan/aphrodite/issues/comments/293859026","html_url":"https://github.com/Khan/aphrodite/pull/216#issuecomment-293859026","issue_url":"https://api.github.com/repos/Khan/aphrodite/issues/216","id":293859026,"user":{"login":"SamyPesse","id":845425,"avatar_url":"https://avatars0.githubusercontent.com/u/845425?v=3","gravatar_id":"","url":"https://api.github.com/users/SamyPesse","html_url":"https://github.com/SamyPesse","followers_url":"https://api.github.com/users/SamyPesse/followers","following_url":"https://api.github.com/users/SamyPesse/following{/other_user}","gists_url":"https://api.github.com/users/SamyPesse/gists{/gist_id}","starred_url":"https://api.github.com/users/SamyPesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamyPesse/subscriptions","organizations_url":"https://api.github.com/users/SamyPesse/orgs","repos_url":"https://api.github.com/users/SamyPesse/repos","events_url":"https://api.github.com/users/SamyPesse/events{/privacy}","received_events_url":"https://api.github.com/users/SamyPesse/received_events","type":"User","site_admin":false},"created_at":"2017-04-13T11:02:20Z","updated_at":"2017-04-13T11:02:20Z","body":"Thanks @lencioni 🍻 \r\n\r\nAny chance someone from Khan can review it ? (@xymostech) This PR fixes #231."}}
{"actor":{"display_login":"SamyPesse"}}