{"action":"closed","number":7,"pull_request":{"url":"https://api.github.com/repos/mubit/sse/pulls/7","id":90488436,"html_url":"https://github.com/mubit/sse/pull/7","diff_url":"https://github.com/mubit/sse/pull/7.diff","patch_url":"https://github.com/mubit/sse/pull/7.patch","issue_url":"https://api.github.com/repos/mubit/sse/issues/7","number":7,"state":"closed","locked":false,"title":"Faster decoder implemented using bufio.Scanner","user":{"login":"dolmen","id":129536,"avatar_url":"https://avatars.githubusercontent.com/u/129536?v=3","gravatar_id":"","url":"https://api.github.com/users/dolmen","html_url":"https://github.com/dolmen","followers_url":"https://api.github.com/users/dolmen/followers","following_url":"https://api.github.com/users/dolmen/following{/other_user}","gists_url":"https://api.github.com/users/dolmen/gists{/gist_id}","starred_url":"https://api.github.com/users/dolmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolmen/subscriptions","organizations_url":"https://api.github.com/users/dolmen/orgs","repos_url":"https://api.github.com/users/dolmen/repos","events_url":"https://api.github.com/users/dolmen/events{/privacy}","received_events_url":"https://api.github.com/users/dolmen/received_events","type":"User","site_admin":false},"body":"Less code as I reuse [bufio.Scanner](https://golang.org/pkg/bufio/#Scanner) (with a specific separator function to recognize CRLF / CR / LF). Faster and less memory allocations.\r\n\r\nBefore:\r\n```\r\nBenchmarkDecodeEmptyEvent-4\t\t\t 5000000       369 ns/op     72 B/op       3 allocs/op\r\nBenchmarkDecodeEmptyEventWithIgnoredLine-4\t 3000000       568 ns/op     90 B/op       5 allocs/op\r\nBenchmarkDecodeShortEvent-4\t\t\t 3000000       441 ns/op    112 B/op       4 allocs/op\r\nBenchmarkDecode1kEvent-4\t\t\t 5000000      2748 ns/op   2113 B/op       4 allocs/op\r\nBenchmarkDecode4kEvent-4\t\t\t  200000      9575 ns/op   8257 B/op       4 allocs/op\r\nBenchmarkDecode8kEvent-4\t\t\t  100000     19882 ns/op  16449 B/op       4 allocs/op\r\nBenchmarkDecode16kEvent-4\t\t\t 3000000     40632 ns/op  41059 B/op       6 allocs/op\r\n```\r\nAfter:\r\n```\r\nBenchmarkDecodeEmptyEvent-4\t\t\t 5000000       263 ns/op     72 B/op       2 allocs/op\r\nBenchmarkDecodeEmptyEventWithIgnoredLine-4\t 5000000       363 ns/op     88 B/op       3 allocs/op\r\nBenchmarkDecodeShortEvent-4\t\t\t 5000000       304 ns/op    112 B/op       3 allocs/op\r\nBenchmarkDecode1kEvent-4\t\t\t 1000000      1725 ns/op   2112 B/op       3 allocs/op\r\nBenchmarkDecode4kEvent-4\t\t\t  200000      5720 ns/op   8256 B/op       3 allocs/op\r\nBenchmarkDecode8kEvent-4\t\t\t  200000     11410 ns/op  16448 B/op       3 allocs/op\r\nBenchmarkDecode16kEvent-4\t\t\t 1000000     21835 ns/op  32832 B/op       3 allocs/op\r\n```","created_at":"2016-10-22T17:09:44Z","updated_at":"2016-10-22T20:43:15Z","closed_at":"2016-10-22T20:43:15Z","merged_at":null,"merge_commit_sha":"f650aa3dd25cc16a0a732513081c6250ddb049f7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mubit/sse/pulls/7/commits","review_comments_url":"https://api.github.com/repos/mubit/sse/pulls/7/comments","review_comment_url":"https://api.github.com/repos/mubit/sse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mubit/sse/issues/7/comments","statuses_url":"https://api.github.com/repos/mubit/sse/statuses/67a38c257eacc9245463a2c78992cb3f198e866f","head":{"label":"dolmen-go:faster-decoder","ref":"faster-decoder","sha":"67a38c257eacc9245463a2c78992cb3f198e866f","user":{"login":"dolmen-go","id":22580372,"avatar_url":"https://avatars.githubusercontent.com/u/22580372?v=3","gravatar_id":"","url":"https://api.github.com/users/dolmen-go","html_url":"https://github.com/dolmen-go","followers_url":"https://api.github.com/users/dolmen-go/followers","following_url":"https://api.github.com/users/dolmen-go/following{/other_user}","gists_url":"https://api.github.com/users/dolmen-go/gists{/gist_id}","starred_url":"https://api.github.com/users/dolmen-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolmen-go/subscriptions","organizations_url":"https://api.github.com/users/dolmen-go/orgs","repos_url":"https://api.github.com/users/dolmen-go/repos","events_url":"https://api.github.com/users/dolmen-go/events{/privacy}","received_events_url":"https://api.github.com/users/dolmen-go/received_events","type":"Organization","site_admin":false},"repo":{"id":71291578,"name":"sse","full_name":"dolmen-go/sse","owner":{"login":"dolmen-go","id":22580372,"avatar_url":"https://avatars.githubusercontent.com/u/22580372?v=3","gravatar_id":"","url":"https://api.github.com/users/dolmen-go","html_url":"https://github.com/dolmen-go","followers_url":"https://api.github.com/users/dolmen-go/followers","following_url":"https://api.github.com/users/dolmen-go/following{/other_user}","gists_url":"https://api.github.com/users/dolmen-go/gists{/gist_id}","starred_url":"https://api.github.com/users/dolmen-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolmen-go/subscriptions","organizations_url":"https://api.github.com/users/dolmen-go/orgs","repos_url":"https://api.github.com/users/dolmen-go/repos","events_url":"https://api.github.com/users/dolmen-go/events{/privacy}","received_events_url":"https://api.github.com/users/dolmen-go/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dolmen-go/sse","description":"Go HTML5 Server-Sent Events (SSE) client.","fork":true,"url":"https://api.github.com/repos/dolmen-go/sse","forks_url":"https://api.github.com/repos/dolmen-go/sse/forks","keys_url":"https://api.github.com/repos/dolmen-go/sse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dolmen-go/sse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dolmen-go/sse/teams","hooks_url":"https://api.github.com/repos/dolmen-go/sse/hooks","issue_events_url":"https://api.github.com/repos/dolmen-go/sse/issues/events{/number}","events_url":"https://api.github.com/repos/dolmen-go/sse/events","assignees_url":"https://api.github.com/repos/dolmen-go/sse/assignees{/user}","branches_url":"https://api.github.com/repos/dolmen-go/sse/branches{/branch}","tags_url":"https://api.github.com/repos/dolmen-go/sse/tags","blobs_url":"https://api.github.com/repos/dolmen-go/sse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dolmen-go/sse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dolmen-go/sse/git/refs{/sha}","trees_url":"https://api.github.com/repos/dolmen-go/sse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dolmen-go/sse/statuses/{sha}","languages_url":"https://api.github.com/repos/dolmen-go/sse/languages","stargazers_url":"https://api.github.com/repos/dolmen-go/sse/stargazers","contributors_url":"https://api.github.com/repos/dolmen-go/sse/contributors","subscribers_url":"https://api.github.com/repos/dolmen-go/sse/subscribers","subscription_url":"https://api.github.com/repos/dolmen-go/sse/subscription","commits_url":"https://api.github.com/repos/dolmen-go/sse/commits{/sha}","git_commits_url":"https://api.github.com/repos/dolmen-go/sse/git/commits{/sha}","comments_url":"https://api.github.com/repos/dolmen-go/sse/comments{/number}","issue_comment_url":"https://api.github.com/repos/dolmen-go/sse/issues/comments{/number}","contents_url":"https://api.github.com/repos/dolmen-go/sse/contents/{+path}","compare_url":"https://api.github.com/repos/dolmen-go/sse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dolmen-go/sse/merges","archive_url":"https://api.github.com/repos/dolmen-go/sse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dolmen-go/sse/downloads","issues_url":"https://api.github.com/repos/dolmen-go/sse/issues{/number}","pulls_url":"https://api.github.com/repos/dolmen-go/sse/pulls{/number}","milestones_url":"https://api.github.com/repos/dolmen-go/sse/milestones{/number}","notifications_url":"https://api.github.com/repos/dolmen-go/sse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dolmen-go/sse/labels{/name}","releases_url":"https://api.github.com/repos/dolmen-go/sse/releases{/id}","deployments_url":"https://api.github.com/repos/dolmen-go/sse/deployments","created_at":"2016-10-18T21:09:42Z","updated_at":"2016-10-18T21:09:43Z","pushed_at":"2016-10-22T20:40:23Z","git_url":"git://github.com/dolmen-go/sse.git","ssh_url":"git@github.com:dolmen-go/sse.git","clone_url":"https://github.com/dolmen-go/sse.git","svn_url":"https://github.com/dolmen-go/sse","homepage":"","size":49,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mubit:master","ref":"master","sha":"63b95c02adb02792bb5f09bf66b47cedecf809b9","user":{"login":"mubit","id":1598612,"avatar_url":"https://avatars.githubusercontent.com/u/1598612?v=3","gravatar_id":"","url":"https://api.github.com/users/mubit","html_url":"https://github.com/mubit","followers_url":"https://api.github.com/users/mubit/followers","following_url":"https://api.github.com/users/mubit/following{/other_user}","gists_url":"https://api.github.com/users/mubit/gists{/gist_id}","starred_url":"https://api.github.com/users/mubit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mubit/subscriptions","organizations_url":"https://api.github.com/users/mubit/orgs","repos_url":"https://api.github.com/users/mubit/repos","events_url":"https://api.github.com/users/mubit/events{/privacy}","received_events_url":"https://api.github.com/users/mubit/received_events","type":"Organization","site_admin":false},"repo":{"id":49036730,"name":"sse","full_name":"mubit/sse","owner":{"login":"mubit","id":1598612,"avatar_url":"https://avatars.githubusercontent.com/u/1598612?v=3","gravatar_id":"","url":"https://api.github.com/users/mubit","html_url":"https://github.com/mubit","followers_url":"https://api.github.com/users/mubit/followers","following_url":"https://api.github.com/users/mubit/following{/other_user}","gists_url":"https://api.github.com/users/mubit/gists{/gist_id}","starred_url":"https://api.github.com/users/mubit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mubit/subscriptions","organizations_url":"https://api.github.com/users/mubit/orgs","repos_url":"https://api.github.com/users/mubit/repos","events_url":"https://api.github.com/users/mubit/events{/privacy}","received_events_url":"https://api.github.com/users/mubit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mubit/sse","description":"Go HTML5 Server-Sent Events (SSE) client.","fork":false,"url":"https://api.github.com/repos/mubit/sse","forks_url":"https://api.github.com/repos/mubit/sse/forks","keys_url":"https://api.github.com/repos/mubit/sse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mubit/sse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mubit/sse/teams","hooks_url":"https://api.github.com/repos/mubit/sse/hooks","issue_events_url":"https://api.github.com/repos/mubit/sse/issues/events{/number}","events_url":"https://api.github.com/repos/mubit/sse/events","assignees_url":"https://api.github.com/repos/mubit/sse/assignees{/user}","branches_url":"https://api.github.com/repos/mubit/sse/branches{/branch}","tags_url":"https://api.github.com/repos/mubit/sse/tags","blobs_url":"https://api.github.com/repos/mubit/sse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mubit/sse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mubit/sse/git/refs{/sha}","trees_url":"https://api.github.com/repos/mubit/sse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mubit/sse/statuses/{sha}","languages_url":"https://api.github.com/repos/mubit/sse/languages","stargazers_url":"https://api.github.com/repos/mubit/sse/stargazers","contributors_url":"https://api.github.com/repos/mubit/sse/contributors","subscribers_url":"https://api.github.com/repos/mubit/sse/subscribers","subscription_url":"https://api.github.com/repos/mubit/sse/subscription","commits_url":"https://api.github.com/repos/mubit/sse/commits{/sha}","git_commits_url":"https://api.github.com/repos/mubit/sse/git/commits{/sha}","comments_url":"https://api.github.com/repos/mubit/sse/comments{/number}","issue_comment_url":"https://api.github.com/repos/mubit/sse/issues/comments{/number}","contents_url":"https://api.github.com/repos/mubit/sse/contents/{+path}","compare_url":"https://api.github.com/repos/mubit/sse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mubit/sse/merges","archive_url":"https://api.github.com/repos/mubit/sse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mubit/sse/downloads","issues_url":"https://api.github.com/repos/mubit/sse/issues{/number}","pulls_url":"https://api.github.com/repos/mubit/sse/pulls{/number}","milestones_url":"https://api.github.com/repos/mubit/sse/milestones{/number}","notifications_url":"https://api.github.com/repos/mubit/sse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mubit/sse/labels{/name}","releases_url":"https://api.github.com/repos/mubit/sse/releases{/id}","deployments_url":"https://api.github.com/repos/mubit/sse/deployments","created_at":"2016-01-05T02:29:21Z","updated_at":"2016-10-22T15:06:22Z","pushed_at":"2016-10-22T20:40:23Z","git_url":"git://github.com/mubit/sse.git","ssh_url":"git@github.com:mubit/sse.git","clone_url":"https://github.com/mubit/sse.git","svn_url":"https://github.com/mubit/sse","homepage":"","size":62,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mubit/sse/pulls/7"},"html":{"href":"https://github.com/mubit/sse/pull/7"},"issue":{"href":"https://api.github.com/repos/mubit/sse/issues/7"},"comments":{"href":"https://api.github.com/repos/mubit/sse/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/mubit/sse/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/mubit/sse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mubit/sse/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/mubit/sse/statuses/67a38c257eacc9245463a2c78992cb3f198e866f"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":3,"review_comments":1,"commits":1,"additions":166,"deletions":135,"changed_files":3}}
{"actor":{"display_login":"dolmen"}}