{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/356","repository_url":"https://api.github.com/repos/influxdata/kapacitor","labels_url":"https://api.github.com/repos/influxdata/kapacitor/issues/356/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/kapacitor/issues/356/comments","events_url":"https://api.github.com/repos/influxdata/kapacitor/issues/356/events","html_url":"https://github.com/influxdata/kapacitor/pull/356","id":141934072,"number":356,"title":"reduce allocs and map indexes for CollectPoint","user":{"login":"nathanielc","id":3771906,"avatar_url":"https://avatars.githubusercontent.com/u/3771906?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielc","html_url":"https://github.com/nathanielc","followers_url":"https://api.github.com/users/nathanielc/followers","following_url":"https://api.github.com/users/nathanielc/following{/other_user}","gists_url":"https://api.github.com/users/nathanielc/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielc/subscriptions","organizations_url":"https://api.github.com/users/nathanielc/orgs","repos_url":"https://api.github.com/users/nathanielc/repos","events_url":"https://api.github.com/users/nathanielc/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-18T17:46:02Z","updated_at":"2016-03-18T20:35:52Z","closed_at":"2016-03-18T20:20:10Z","pull_request":{"url":"https://api.github.com/repos/influxdata/kapacitor/pulls/356","html_url":"https://github.com/influxdata/kapacitor/pull/356","diff_url":"https://github.com/influxdata/kapacitor/pull/356.diff","patch_url":"https://github.com/influxdata/kapacitor/pull/356.patch"},"body":"Adds benchmarks from @yosiat.\r\n\r\nTwo changes, instead of statsMap.Add using direct reference to *expvar.Int to avoid map look up.\r\n\r\nChanged args to incCollected/incEmitted to not require heap allocation.\r\n\r\nAdds benchmark for edge.CollectPoint directly. \r\nImprovement is good:\r\n\r\n```\r\nbenchmark                    old ns/op     new ns/op     delta\r\nBenchmark_CollectPoint-8     1031          707           -31.43%\r\n\r\nbenchmark                    old allocs     new allocs     delta\r\nBenchmark_CollectPoint-8     2              0              -100.00%\r\n\r\nbenchmark                    old bytes     new bytes     delta\r\nBenchmark_CollectPoint-8     256           0             -100.00%\r\n```\r\n\r\nImprovement on full write test is good too.\r\n```\r\nbenchmark                                            old ns/op       new ns/op      delta\r\nBenchmark_Write_MeasurementNameNotMatches_1000-4     6273967891      4240956941     -32.40%\r\nBenchmark_Write_MeasurementNameMatches_1000-4        6708792279      4503474984     -32.87%\r\nBenchmark_Write_MeasurementNameNotMatches_100-4      7768092706      4973414305     -35.98%\r\nBenchmark_Write_MeasurementNameMatches_100-4         8383660564      5157680889     -38.48%\r\nBenchmark_Write_MeasurementNameNotMatches_10-4       9831826369      5263307437     -46.47%\r\nBenchmark_Write_MeasurementNameMatches_10-4          10232057586     5258015149     -48.61%\r\n\r\nbenchmark                                            old allocs     new allocs     delta\r\nBenchmark_Write_MeasurementNameNotMatches_1000-4     15462870       57439          -99.63%\r\nBenchmark_Write_MeasurementNameMatches_1000-4        19313940       3901498        -79.80%\r\nBenchmark_Write_MeasurementNameNotMatches_100-4      23090665       4292295        -81.41%\r\nBenchmark_Write_MeasurementNameMatches_100-4         23742484       4800160        -79.78%\r\nBenchmark_Write_MeasurementNameNotMatches_10-4       24095167       4775145        -80.18%\r\nBenchmark_Write_MeasurementNameMatches_10-4          24147784       4890630        -79.75%\r\n\r\nbenchmark                                            old bytes      new bytes     delta\r\nBenchmark_Write_MeasurementNameNotMatches_1000-4     1975214888     4262320       -99.78%\r\nBenchmark_Write_MeasurementNameMatches_1000-4        2405864264     434731368     -81.93%\r\nBenchmark_Write_MeasurementNameNotMatches_100-4      2882851768     478502496     -83.40%\r\nBenchmark_Write_MeasurementNameMatches_100-4         2957967752     535381800     -81.90%\r\nBenchmark_Write_MeasurementNameNotMatches_10-4       3002221608     532581984     -82.26%\r\nBenchmark_Write_MeasurementNameMatches_10-4          3008055144     545516640     -81.86%\r\n```\r\n\r\nCollectPoint is still spending lots of time counting stats, I am playing around with channels based implementation vs atmoic.Add"},"comment":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/comments/198531464","html_url":"https://github.com/influxdata/kapacitor/pull/356#issuecomment-198531464","issue_url":"https://api.github.com/repos/influxdata/kapacitor/issues/356","id":198531464,"user":{"login":"yosiat","id":306253,"avatar_url":"https://avatars.githubusercontent.com/u/306253?v=3","gravatar_id":"","url":"https://api.github.com/users/yosiat","html_url":"https://github.com/yosiat","followers_url":"https://api.github.com/users/yosiat/followers","following_url":"https://api.github.com/users/yosiat/following{/other_user}","gists_url":"https://api.github.com/users/yosiat/gists{/gist_id}","starred_url":"https://api.github.com/users/yosiat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosiat/subscriptions","organizations_url":"https://api.github.com/users/yosiat/orgs","repos_url":"https://api.github.com/users/yosiat/repos","events_url":"https://api.github.com/users/yosiat/events{/privacy}","received_events_url":"https://api.github.com/users/yosiat/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T20:35:52Z","updated_at":"2016-03-18T20:35:52Z","body":"@nathanielc why you didn't used \"buffer.WriteString\" method?"}}