{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/6051","repository_url":"https://api.github.com/repos/scala/scala","labels_url":"https://api.github.com/repos/scala/scala/issues/6051/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/6051/comments","events_url":"https://api.github.com/repos/scala/scala/issues/6051/events","html_url":"https://github.com/scala/scala/pull/6051","id":253999853,"number":6051,"title":"Initialize statistics per global","user":{"login":"jvican","id":2462974,"avatar_url":"https://avatars0.githubusercontent.com/u/2462974?v=4","gravatar_id":"","url":"https://api.github.com/users/jvican","html_url":"https://github.com/jvican","followers_url":"https://api.github.com/users/jvican/followers","following_url":"https://api.github.com/users/jvican/following{/other_user}","gists_url":"https://api.github.com/users/jvican/gists{/gist_id}","starred_url":"https://api.github.com/users/jvican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvican/subscriptions","organizations_url":"https://api.github.com/users/jvican/orgs","repos_url":"https://api.github.com/users/jvican/repos","events_url":"https://api.github.com/users/jvican/events{/privacy}","received_events_url":"https://api.github.com/users/jvican/received_events","type":"User","site_admin":false},"labels":[{"id":703512654,"url":"https://api.github.com/repos/scala/scala/labels/prio:hi","name":"prio:hi","color":"e99695","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/64","html_url":"https://github.com/scala/scala/milestone/64","labels_url":"https://api.github.com/repos/scala/scala/milestones/64/labels","id":2526022,"number":64,"title":"2.12.4","description":"2.12 now in maintenance mode: non-critical work should target 2.13. \r\n\r\nRelease Lead: @adriaanm","creator":{"login":"retronym","id":65551,"avatar_url":"https://avatars0.githubusercontent.com/u/65551?v=4","gravatar_id":"","url":"https://api.github.com/users/retronym","html_url":"https://github.com/retronym","followers_url":"https://api.github.com/users/retronym/followers","following_url":"https://api.github.com/users/retronym/following{/other_user}","gists_url":"https://api.github.com/users/retronym/gists{/gist_id}","starred_url":"https://api.github.com/users/retronym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retronym/subscriptions","organizations_url":"https://api.github.com/users/retronym/orgs","repos_url":"https://api.github.com/users/retronym/repos","events_url":"https://api.github.com/users/retronym/events{/privacy}","received_events_url":"https://api.github.com/users/retronym/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":80,"state":"closed","created_at":"2017-05-17T04:00:00Z","updated_at":"2017-10-18T20:08:07Z","due_on":"2017-09-29T07:00:00Z","closed_at":"2017-10-09T23:26:24Z"},"comments":43,"created_at":"2017-08-30T13:30:41Z","updated_at":"2017-12-19T12:36:27Z","closed_at":"2017-09-28T17:35:33Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/6051","html_url":"https://github.com/scala/scala/pull/6051","diff_url":"https://github.com/scala/scala/pull/6051.diff","patch_url":"https://github.com/scala/scala/pull/6051.patch"},"body":"As described in the bug report, statistics are currently shared by\r\ndifferent instances of `Global` because they are located in objects.\r\n\r\nThis approach has an important disadvantage.  Statistics from different\r\nglobal instances step on each other's toes, rendering the statistics\r\ninfrastructure unusable in most of the Scala developers' workflows\r\n(think sbt running in parallel several compilations). When the data is\r\nnot useless, it produces races conditions and kills compilation.\r\n\r\nThis patch addresses the issue by creating a new object in `SymbolTable`\r\nthat is overriden in `Global` and hence available to most of the\r\ncompiler internals. This object contains all the statistics at the known\r\ndefinition site (`Global` defines more statistics that are created in\r\n`scala.tools.nsc` instead of `scala.reflect`).\r\n\r\nThe main goal of this implementation was to avoid moving the definition\r\nof statistics from the places where they are used. Currently, they are\r\ndefined alongside the classes that have the call-sites (see, for\r\nexample, `Implicits.scala`, `Macros.scala` or `Types.scala`).\r\n\r\n**NOTE**: This PR builds upon https://github.com/scala/scala/pull/6034, so it needs to be merged after it.\r\n  \r\n**EDIT**: Here's a summary of what this PR does:\r\n  \r\n1. It makes an overhaul of the previous statistics infrastructure that was\r\ndependent on global objects shared by different instances of Global (making the\r\nstats unusable in most of the cases).\r\n1. It enables IOStats with a special trick that uses ThreadLocal to share\r\ninstances of quantities (timers/counters) as suggested by @lrytz.\r\n1. It modifies the statistics framework to listen to changes in the mutable\r\nsettings and thus enable/disable according to what the driver of the compiler\r\ndoes. This allows to run statistics in controlled and interactive environments,\r\nenabling and disabling several times on the go.\r\n1. It deduplicates calls to canEnable that could be hindering optimizations or\r\naffecting the runtime.\r\n\r\nFix scala/bug#10460"},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/352737219","html_url":"https://github.com/scala/scala/pull/6051#issuecomment-352737219","issue_url":"https://api.github.com/repos/scala/scala/issues/6051","id":352737219,"user":{"login":"retronym","id":65551,"avatar_url":"https://avatars0.githubusercontent.com/u/65551?v=4","gravatar_id":"","url":"https://api.github.com/users/retronym","html_url":"https://github.com/retronym","followers_url":"https://api.github.com/users/retronym/followers","following_url":"https://api.github.com/users/retronym/following{/other_user}","gists_url":"https://api.github.com/users/retronym/gists{/gist_id}","starred_url":"https://api.github.com/users/retronym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retronym/subscriptions","organizations_url":"https://api.github.com/users/retronym/orgs","repos_url":"https://api.github.com/users/retronym/repos","events_url":"https://api.github.com/users/retronym/events{/privacy}","received_events_url":"https://api.github.com/users/retronym/received_events","type":"User","site_admin":false},"created_at":"2017-12-19T12:36:27Z","updated_at":"2017-12-19T12:36:27Z","author_association":"OWNER","body":"It's possible that I've bisected this incorrectly and am witnessing a problem that was was already fixed by 1c47b2ffad20b6f589255b3c935c8538fd714403 (\"don't try to re-disabled the almost final value\")"}}
{"actor":{"display_login":"retronym"}}