{"action":"created","issue":{"url":"https://api.github.com/repos/krlmlr/styler/issues/78","repository_url":"https://api.github.com/repos/krlmlr/styler","labels_url":"https://api.github.com/repos/krlmlr/styler/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/krlmlr/styler/issues/78/comments","events_url":"https://api.github.com/repos/krlmlr/styler/issues/78/events","html_url":"https://github.com/krlmlr/styler/issues/78","id":243966018,"number":78,"title":"make styler faster","user":{"login":"lorenzwalthert","id":10477073,"avatar_url":"https://avatars1.githubusercontent.com/u/10477073?v=4","gravatar_id":"","url":"https://api.github.com/users/lorenzwalthert","html_url":"https://github.com/lorenzwalthert","followers_url":"https://api.github.com/users/lorenzwalthert/followers","following_url":"https://api.github.com/users/lorenzwalthert/following{/other_user}","gists_url":"https://api.github.com/users/lorenzwalthert/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzwalthert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzwalthert/subscriptions","organizations_url":"https://api.github.com/users/lorenzwalthert/orgs","repos_url":"https://api.github.com/users/lorenzwalthert/repos","events_url":"https://api.github.com/users/lorenzwalthert/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzwalthert/received_events","type":"User","site_admin":false},"labels":[{"id":535231671,"url":"https://api.github.com/repos/krlmlr/styler/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-19T08:45:54Z","updated_at":"2017-07-19T20:48:25Z","closed_at":null,"body":"The following could make styler run faster: \r\n\r\n* dropping unnecessary `select()` and `arrange()` statements.\r\n* early termination (e.g. rules?)\r\n* consider replacing some tidyverse calls with base R if substitution\r\n   does not make the code \"uggly\"? What do you think @krlmlr ?\r\n\r\n\r\n``` r\r\nmicrobenchmark::microbenchmark(dplyr = dplyr::mutate(mtcars, driver = 3), \r\n                               baseR = mtcars$driver <- 3)\r\n#> Unit: microseconds\r\n#>   expr      min       lq      mean   median        uq        max neval cld\r\n#>  dplyr 1969.341 2009.056 3740.7995 2037.379 2091.4205 152117.420   100   b\r\n#>  baseR   11.663   13.735   24.1628   20.456   22.9275    433.822   100  a\r\n\r\nmicrobenchmark::microbenchmark(dplyr = dplyr::slice(mtcars, 1:3), \r\n                               baseR = mtcars[1:3, ])\r\n#> Unit: microseconds\r\n#>   expr      min       lq      mean    median       uq      max neval cld\r\n#>  dplyr 2094.290 2148.480 2446.0150 2191.8545 2271.761 8700.220   100   b\r\n#>  baseR  138.072  155.203  176.9532  165.3705  189.216  431.295   100  a\r\n\r\n# pipe does probably not slow down things much.\r\nlibrary(magrittr)\r\nmicrobenchmark::microbenchmark(dplyr = mtcars %>% summary(), \r\n                               baseR = summary(mtcars))\r\n#> Unit: milliseconds\r\n#>   expr      min       lq     mean   median       uq      max neval cld\r\n#>  dplyr 4.550347 4.619500 5.089398 4.695070 4.833018 9.004815   100   a\r\n#>  baseR 4.390407 4.497096 4.924098 4.548395 4.833101 8.284952   100   a\r\n```\r\n\r\nThese are just some thoughts, profiling of *our* code is probably a better place to start anyways...\r\n"},"comment":{"url":"https://api.github.com/repos/krlmlr/styler/issues/comments/316512501","html_url":"https://github.com/krlmlr/styler/issues/78#issuecomment-316512501","issue_url":"https://api.github.com/repos/krlmlr/styler/issues/78","id":316512501,"user":{"login":"krlmlr","id":1741643,"avatar_url":"https://avatars0.githubusercontent.com/u/1741643?v=4","gravatar_id":"","url":"https://api.github.com/users/krlmlr","html_url":"https://github.com/krlmlr","followers_url":"https://api.github.com/users/krlmlr/followers","following_url":"https://api.github.com/users/krlmlr/following{/other_user}","gists_url":"https://api.github.com/users/krlmlr/gists{/gist_id}","starred_url":"https://api.github.com/users/krlmlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlmlr/subscriptions","organizations_url":"https://api.github.com/users/krlmlr/orgs","repos_url":"https://api.github.com/users/krlmlr/repos","events_url":"https://api.github.com/users/krlmlr/events{/privacy}","received_events_url":"https://api.github.com/users/krlmlr/received_events","type":"User","site_admin":false},"created_at":"2017-07-19T20:48:25Z","updated_at":"2017-07-19T20:48:25Z","body":"Let's identify our bottlenecks first, you could try profvis."}}
{"actor":{"display_login":"krlmlr"}}