{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/13438","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/13438/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/13438/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/13438/events","html_url":"https://github.com/cockroachdb/cockroach/issues/13438","id":205726138,"number":13438,"title":"util/log: AmbientContext.AnnotateCtx is allocation heavy","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars0.githubusercontent.com/u/6201335?v=4","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"labels":[{"id":406290612,"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/C-performance","name":"C-performance","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"RaduBerinde","id":16544120,"avatar_url":"https://avatars1.githubusercontent.com/u/16544120?v=4","gravatar_id":"","url":"https://api.github.com/users/RaduBerinde","html_url":"https://github.com/RaduBerinde","followers_url":"https://api.github.com/users/RaduBerinde/followers","following_url":"https://api.github.com/users/RaduBerinde/following{/other_user}","gists_url":"https://api.github.com/users/RaduBerinde/gists{/gist_id}","starred_url":"https://api.github.com/users/RaduBerinde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaduBerinde/subscriptions","organizations_url":"https://api.github.com/users/RaduBerinde/orgs","repos_url":"https://api.github.com/users/RaduBerinde/repos","events_url":"https://api.github.com/users/RaduBerinde/events{/privacy}","received_events_url":"https://api.github.com/users/RaduBerinde/received_events","type":"User","site_admin":false},"assignees":[{"login":"RaduBerinde","id":16544120,"avatar_url":"https://avatars1.githubusercontent.com/u/16544120?v=4","gravatar_id":"","url":"https://api.github.com/users/RaduBerinde","html_url":"https://github.com/RaduBerinde","followers_url":"https://api.github.com/users/RaduBerinde/followers","following_url":"https://api.github.com/users/RaduBerinde/following{/other_user}","gists_url":"https://api.github.com/users/RaduBerinde/gists{/gist_id}","starred_url":"https://api.github.com/users/RaduBerinde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaduBerinde/subscriptions","organizations_url":"https://api.github.com/users/RaduBerinde/orgs","repos_url":"https://api.github.com/users/RaduBerinde/repos","events_url":"https://api.github.com/users/RaduBerinde/events{/privacy}","received_events_url":"https://api.github.com/users/RaduBerinde/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cockroachdb/cockroach/milestones/3","html_url":"https://github.com/cockroachdb/cockroach/milestone/3","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones/3/labels","id":1298443,"number":3,"title":"Later","description":"","creator":{"login":"BramGruneir","id":1614265,"avatar_url":"https://avatars1.githubusercontent.com/u/1614265?v=4","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false},"open_issues":512,"closed_issues":222,"state":"open","created_at":"2015-09-09T21:24:17Z","updated_at":"2018-04-27T11:03:51Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2017-02-06T22:24:07Z","updated_at":"2018-04-27T11:49:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In a simple write-only workload (`loadgen/kv`), `AmbientContext.AnnotateCtx` is responsible for ~6.5% of the total allocations. Unfortunately, this code is tuned and inspection doesn't reveal any easy fixes. The allocations all come out of `augmentTagChain`. We take the fast-path ~2/3 of the time which performs a single `context.WithValue`. And the other 1/3 of the time we take the slow-path which involves merging with the existing tag chain. The fast-path, despite being used 2/3 of the time, consumes 1/3 of the allocations. \r\n\r\nI'm not sure what can be done here with the constraints of `context.Context`. A radical thought is to provide our own `Context` struct that is passed by value and internally contains a `context.Context` and a tag chain."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/384947540","html_url":"https://github.com/cockroachdb/cockroach/issues/13438#issuecomment-384947540","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/13438","id":384947540,"user":{"login":"knz","id":642886,"avatar_url":"https://avatars3.githubusercontent.com/u/642886?v=4","gravatar_id":"","url":"https://api.github.com/users/knz","html_url":"https://github.com/knz","followers_url":"https://api.github.com/users/knz/followers","following_url":"https://api.github.com/users/knz/following{/other_user}","gists_url":"https://api.github.com/users/knz/gists{/gist_id}","starred_url":"https://api.github.com/users/knz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knz/subscriptions","organizations_url":"https://api.github.com/users/knz/orgs","repos_url":"https://api.github.com/users/knz/repos","events_url":"https://api.github.com/users/knz/events{/privacy}","received_events_url":"https://api.github.com/users/knz/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T11:49:35Z","updated_at":"2018-04-27T11:49:35Z","author_association":"OWNER","body":"cc @nvanbenschoten for prioritization"}}
{"actor":{"display_login":"knz"}}