{"action":"created","issue":{"url":"https://api.github.com/repos/tweag/rules_haskell/issues/109","repository_url":"https://api.github.com/repos/tweag/rules_haskell","labels_url":"https://api.github.com/repos/tweag/rules_haskell/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/tweag/rules_haskell/issues/109/comments","events_url":"https://api.github.com/repos/tweag/rules_haskell/issues/109/events","html_url":"https://github.com/tweag/rules_haskell/pull/109","id":292437733,"number":109,"title":"Set experiments","user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars0.githubusercontent.com/u/8165792?v=4","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-01-29T14:59:03Z","updated_at":"2018-02-02T12:07:35Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/tweag/rules_haskell/pulls/109","html_url":"https://github.com/tweag/rules_haskell/pull/109","diff_url":"https://github.com/tweag/rules_haskell/pull/109.diff","patch_url":"https://github.com/tweag/rules_haskell/pull/109.patch"},"body":"Close #77."},"comment":{"url":"https://api.github.com/repos/tweag/rules_haskell/issues/comments/362569582","html_url":"https://github.com/tweag/rules_haskell/pull/109#issuecomment-362569582","issue_url":"https://api.github.com/repos/tweag/rules_haskell/issues/109","id":362569582,"user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars0.githubusercontent.com/u/8165792?v=4","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T12:07:35Z","updated_at":"2018-02-02T12:07:35Z","author_association":"MEMBER","body":"## How to obtain the results\r\n\r\nThe results presented below may be obtained in the following way:\r\n\r\n* Clone, build, and install [spit-haskell-rules].\r\n* Make a new directory `cd` into it, and populate it with a dummy repo:\r\n\r\n  ```\r\n  $ mkdir profiling\r\n  $ cd profiling\r\n  $ spit-haskell-rules -d 100 -w 100\r\n  ```\r\n  This will generate a repo with 10 000 packages which depend on each other in the way described in the readme of [spit-haskell-rules].\r\n\r\n* To profile the `master` branch (i.e. depsets version), execute:\r\n\r\n  ```\r\n  $ bazel build --nobuild --profile=depset.out :39e5b4830d4d9c14db7368a95b65d5463ea3d09520373723430c03a5a453b5df\r\n  $ bazel analyze-profile depset.out --html --html_details\r\n  ```\r\n\r\n* To profile the `set-experiments` branch, edit `WORKSPACE` file accordingly either using `local_repository` to point to local copy of `rules_haskell` with the `set-experiments` branch checked out, or edit the name of branch in the existing `http_archive`. Then proceed as usual:\r\n\r\n  ```\r\n  $ bazel build --nobuild --profile=set.out :39e5b4830d4d9c14db7368a95b65d5463ea3d09520373723430c03a5a453b5df\r\n  $ bazel analyze-profile set.out --html --html_details\r\n  ```\r\n## The results\r\n\r\nWith 10 000 packages the profiling results seem to be more or less reproducable. Sets are depsets perform almost the same:\r\n\r\n|        | Total execution time | \r\n| ------ | -------------------- |\r\n| Depset | 14.786               |\r\n| Set    | 14.048               |\r\n\r\n\r\nTop user-defined functions with depsets:\r\n\r\n| # | Function              | Total      | Relative (%) |\r\n|---|:----------------------|-----------:|-------------:|\r\n| 1 | _haskell_library_impl | 75,087.905 | 32.523%      |\r\n| 2 | compile_haskell_lib   | 27,923.646 | 12.095%      |\r\n| 3 | create_ghc_package    | 26,986.995 | 11.689%      |\r\n| 4 | compilation_defaults  | 18,974.631 | 8.218%       |\r\n\r\nTop built-in functions with depsets:\r\n\r\n| # | Function              | Total      | Relative (%) |\r\n|---|:----------------------|-----------:|-------------:|\r\n| 1 | depset                | 3,326.617  | 30.778%      |\r\n| 2 | join                  | 1,667.174  | 15.425%      |\r\n| 3 | format                | 1,197.12   | 11.076%      |\r\n| 4 | add                   | 1,069.089  | 9.891%       |\r\n\r\nTop user-defined functions with sets:\r\n\r\n| # | Function              | Total      | Relative (%) |\r\n|---|:----------------------|-----------:|-------------:|\r\n| 1 | _haskell_library_impl | 69,216.406 | 31.774%      |\r\n| 2 | compile_haskell_lib   | 29,611.637 | 13.593%      |\r\n| 3 | compilation_defaults  | 20,620.454 | 9.466%       |\r\n| 4 | create_ghc_package    | 16,858.272 | 7.739%       |\r\n\r\nTop built-in function with sets:\r\n\r\n| # | Function              | Total      | Relative (%) |\r\n|---|:----------------------|-----------:|-------------:|\r\n| 1 | format                | 2,327.287  | 18.935%      |\r\n| 2 | depset                | 2,257.03   | 18.363%      |\r\n| 3 | join                  | 2,247.517  | 18.286%      |\r\n| 4 | update                | 1,322.728  | 10.762%      |\r\n\r\nThat said, I fail to see how the thing we're measuring can be a bottleneck, because the time spent manipulating depsets or sets is negligible compared to the time spent running `ghc` and other executables. Maybe I'm missing something here, but the main benefit with sets is just nicer code, it's good to have them in your toolbox and they are occasionally useful.\r\n\r\n[spit-haskell-rules]: https://github.com/mrkkrp/spit-haskell-rules"}}
{"actor":{"display_login":"mrkkrp"}}