{"action":"created","issue":{"url":"https://api.github.com/repos/beorn7/perks/issues/3","repository_url":"https://api.github.com/repos/beorn7/perks","labels_url":"https://api.github.com/repos/beorn7/perks/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/beorn7/perks/issues/3/comments","events_url":"https://api.github.com/repos/beorn7/perks/issues/3/events","html_url":"https://github.com/beorn7/perks/pull/3","id":307137066,"number":3,"title":"Avoid iterating on maps","user":{"login":"mattbostock","id":4348848,"avatar_url":"https://avatars3.githubusercontent.com/u/4348848?v=4","gravatar_id":"","url":"https://api.github.com/users/mattbostock","html_url":"https://github.com/mattbostock","followers_url":"https://api.github.com/users/mattbostock/followers","following_url":"https://api.github.com/users/mattbostock/following{/other_user}","gists_url":"https://api.github.com/users/mattbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbostock/subscriptions","organizations_url":"https://api.github.com/users/mattbostock/orgs","repos_url":"https://api.github.com/users/mattbostock/repos","events_url":"https://api.github.com/users/mattbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mattbostock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-21T07:01:06Z","updated_at":"2018-03-21T16:47:44Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/beorn7/perks/pulls/3","html_url":"https://github.com/beorn7/perks/pull/3","diff_url":"https://github.com/beorn7/perks/pull/3.diff","patch_url":"https://github.com/beorn7/perks/pull/3.patch"},"body":"Speed up `InsertTargeted*` functions by at least 2x by avoiding\r\niterating on maps.\r\n\r\nBefore and after benchmark comparison:\r\n\r\n    benchmark                                 old ns/op     new ns/op     delta\r\n    BenchmarkInsertTargeted-4                 177           73.2          -58.64%\r\n    BenchmarkInsertTargetedSmallEpsilon-4     322           94.6          -70.62%\r\n    BenchmarkInsertBiased-4                   75.8          74.7          -1.45%\r\n    BenchmarkInsertBiasedSmallEpsilon-4       563           571           +1.42%\r\n    BenchmarkQuery-4                          7426          1118          -84.94%\r\n    BenchmarkQuerySmallEpsilon-4              80390         12535         -84.41%\r\n\r\n    benchmark                     old allocs     new allocs     delta\r\n    BenchmarkInsertTargeted-4     0              0              +0.00%\r\n\r\n    benchmark                     old bytes     new bytes     delta\r\n    BenchmarkInsertTargeted-4     0             0             +0.00%\r\n\r\nI considered changing the function signature and require users to pass a\r\nslice to avoid the conversion, but I think that would inconvenience\r\nusers of this library unnecessarily.\r\n\r\nFound by profiling the CPU time spent calculating quantiles in the\r\nPrometheus Go client library."},"comment":{"url":"https://api.github.com/repos/beorn7/perks/issues/comments/375013175","html_url":"https://github.com/beorn7/perks/pull/3#issuecomment-375013175","issue_url":"https://api.github.com/repos/beorn7/perks/issues/3","id":375013175,"user":{"login":"beorn7","id":5609886,"avatar_url":"https://avatars3.githubusercontent.com/u/5609886?v=4","gravatar_id":"","url":"https://api.github.com/users/beorn7","html_url":"https://github.com/beorn7","followers_url":"https://api.github.com/users/beorn7/followers","following_url":"https://api.github.com/users/beorn7/following{/other_user}","gists_url":"https://api.github.com/users/beorn7/gists{/gist_id}","starred_url":"https://api.github.com/users/beorn7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beorn7/subscriptions","organizations_url":"https://api.github.com/users/beorn7/orgs","repos_url":"https://api.github.com/users/beorn7/repos","events_url":"https://api.github.com/users/beorn7/events{/privacy}","received_events_url":"https://api.github.com/users/beorn7/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T16:47:44Z","updated_at":"2018-03-21T16:47:44Z","author_association":"OWNER","body":":+1: Thanks again."}}
{"actor":{"display_login":"beorn7"}}