{"action":"created","comment":{"url":"https://api.github.com/repos/gonum/matrix/pulls/comments/56077151","id":56077151,"diff_hunk":"@@ -276,3 +276,67 @@ func TestVectorIORoundTrip(t *testing.T) {\n \t\t}\n \t}\n }\n+\n+func BenchmarkMarshalDense10(b *testing.B)    { marshalBinaryBenchDense(b, 10) }\n+func BenchmarkMarshalDense100(b *testing.B)   { marshalBinaryBenchDense(b, 100) }\n+func BenchmarkMarshalDense1000(b *testing.B)  { marshalBinaryBenchDense(b, 1000) }\n+func BenchmarkMarshalDense10000(b *testing.B) { marshalBinaryBenchDense(b, 10000) }\n+\n+func marshalBinaryBenchDense(b *testing.B, size int) {\n+\tm := NewDense(1, size, make([]float64, size))\n+\tb.ResetTimer()\n+\n+\tfor n := 0; n < b.N; n++ {\n+\t\t_, _ = m.MarshalBinary()\n+\t}\n+}\n+\n+func BenchmarkUnmarshalDense10(b *testing.B)    { unmarshalBinaryBenchDense(b, 10) }\n+func BenchmarkUnmarshalDense100(b *testing.B)   { unmarshalBinaryBenchDense(b, 100) }\n+func BenchmarkUnmarshalDense1000(b *testing.B)  { unmarshalBinaryBenchDense(b, 1000) }\n+func BenchmarkUnmarshalDense10000(b *testing.B) { unmarshalBinaryBenchDense(b, 10000) }\n+\n+func unmarshalBinaryBenchDense(b *testing.B, size int) {\n+\tbuf, err := NewDense(1, size, make([]float64, size)).MarshalBinary()\n+\tif err != nil {\n+\t\tb.Fatalf(\"error creating binary buffer (size=%d): %v\\n\", size, err)\n+\t}\n+\tb.ResetTimer()\n+\n+\tfor n := 0; n < b.N; n++ {\n+\t\tvar m Dense\n+\t\t_ = m.UnmarshalBinary(buf)\n+\t}\n+}\n+\n+func BenchmarkMarshalVector10(b *testing.B)    { marshalBinaryBenchVector(b, 10) }\n+func BenchmarkMarshalVector100(b *testing.B)   { marshalBinaryBenchVector(b, 100) }\n+func BenchmarkMarshalVector1000(b *testing.B)  { marshalBinaryBenchVector(b, 1000) }\n+func BenchmarkMarshalVector10000(b *testing.B) { marshalBinaryBenchVector(b, 10000) }\n+\n+func marshalBinaryBenchVector(b *testing.B, size int) {\n+\tvec := NewVector(size, make([]float64, size))\n+\tb.ResetTimer()\n+\n+\tfor n := 0; n < b.N; n++ {\n+\t\t_, _ = vec.MarshalBinary()","path":"mat64/io_test.go","position":47,"original_position":47,"commit_id":"a0b03e4ce91b61ca82aa1fc6dfc6711f6e43ab11","original_commit_id":"a0b03e4ce91b61ca82aa1fc6dfc6711f6e43ab11","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-03-14T21:14:19Z","updated_at":"2016-03-14T21:14:19Z","html_url":"https://github.com/gonum/matrix/pull/354#discussion_r56077151","pull_request_url":"https://api.github.com/repos/gonum/matrix/pulls/354","_links":{"self":{"href":"https://api.github.com/repos/gonum/matrix/pulls/comments/56077151"},"html":{"href":"https://github.com/gonum/matrix/pull/354#discussion_r56077151"},"pull_request":{"href":"https://api.github.com/repos/gonum/matrix/pulls/354"}}},"pull_request":{"url":"https://api.github.com/repos/gonum/matrix/pulls/354","id":62643392,"html_url":"https://github.com/gonum/matrix/pull/354","diff_url":"https://github.com/gonum/matrix/pull/354.diff","patch_url":"https://github.com/gonum/matrix/pull/354.patch","issue_url":"https://api.github.com/repos/gonum/matrix/issues/354","number":354,"state":"open","locked":false,"title":"mat64: add r/w benchmarks for Dense and Vector","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"body":"```\r\nBenchmarkMarshalDense10-4      \t  500000\t      2635 ns/op\t     400 B/op\t      26 allocs/op\r\nBenchmarkMarshalDense100-4     \t  100000\t     22186 ns/op\t    2640 B/op\t     206 allocs/op\r\nBenchmarkMarshalDense1000-4    \t   10000\t    218528 ns/op\t   24336 B/op\t    2006 allocs/op\r\nBenchmarkMarshalDense10000-4   \t    1000\t   2173997 ns/op\t  242068 B/op\t   20006 allocs/op\r\nBenchmarkUnmarshalDense10-4    \t 2000000\t       914 ns/op\t     272 B/op\t       8 allocs/op\r\nBenchmarkUnmarshalDense100-4   \t  500000\t      3808 ns/op\t    1904 B/op\t       8 allocs/op\r\nBenchmarkUnmarshalDense1000-4  \t   50000\t     32730 ns/op\t   16496 B/op\t       8 allocs/op\r\nBenchmarkUnmarshalDense10000-4 \t    5000\t    310645 ns/op\t  163955 B/op\t       8 allocs/op\r\nBenchmarkMarshalVector10-4     \t 1000000\t      2467 ns/op\t     384 B/op\t      24 allocs/op\r\nBenchmarkMarshalVector100-4    \t  100000\t     21861 ns/op\t    2624 B/op\t     204 allocs/op\r\nBenchmarkMarshalVector1000-4   \t   10000\t    214783 ns/op\t   24320 B/op\t    2004 allocs/op\r\nBenchmarkMarshalVector10000-4  \t    1000\t   2155109 ns/op\t  242052 B/op\t   20004 allocs/op\r\nBenchmarkUnmarshalVector10-4   \t 2000000\t       813 ns/op\t     256 B/op\t       6 allocs/op\r\nBenchmarkUnmarshalVector100-4  \t  500000\t      3701 ns/op\t    1888 B/op\t       6 allocs/op\r\nBenchmarkUnmarshalVector1000-4 \t   50000\t     32248 ns/op\t   16480 B/op\t       6 allocs/op\r\nBenchmarkUnmarshalVector10000-4\t    5000\t    311020 ns/op\t  163939 B/op\t       6 allocs/op\r\n```\r\nUpdates #346","created_at":"2016-03-12T15:03:01Z","updated_at":"2016-03-14T21:14:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5efc5756715955fbafedcaddb8dad88f3e8d913d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gonum/matrix/pulls/354/commits","review_comments_url":"https://api.github.com/repos/gonum/matrix/pulls/354/comments","review_comment_url":"https://api.github.com/repos/gonum/matrix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gonum/matrix/issues/354/comments","statuses_url":"https://api.github.com/repos/gonum/matrix/statuses/a0b03e4ce91b61ca82aa1fc6dfc6711f6e43ab11","head":{"label":"sbinet:io-bench","ref":"io-bench","sha":"a0b03e4ce91b61ca82aa1fc6dfc6711f6e43ab11","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"repo":{"id":29135086,"name":"gonum-matrix","full_name":"sbinet/gonum-matrix","owner":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sbinet/gonum-matrix","description":"Scientific math package for the Go language.","fork":true,"url":"https://api.github.com/repos/sbinet/gonum-matrix","forks_url":"https://api.github.com/repos/sbinet/gonum-matrix/forks","keys_url":"https://api.github.com/repos/sbinet/gonum-matrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbinet/gonum-matrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbinet/gonum-matrix/teams","hooks_url":"https://api.github.com/repos/sbinet/gonum-matrix/hooks","issue_events_url":"https://api.github.com/repos/sbinet/gonum-matrix/issues/events{/number}","events_url":"https://api.github.com/repos/sbinet/gonum-matrix/events","assignees_url":"https://api.github.com/repos/sbinet/gonum-matrix/assignees{/user}","branches_url":"https://api.github.com/repos/sbinet/gonum-matrix/branches{/branch}","tags_url":"https://api.github.com/repos/sbinet/gonum-matrix/tags","blobs_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbinet/gonum-matrix/statuses/{sha}","languages_url":"https://api.github.com/repos/sbinet/gonum-matrix/languages","stargazers_url":"https://api.github.com/repos/sbinet/gonum-matrix/stargazers","contributors_url":"https://api.github.com/repos/sbinet/gonum-matrix/contributors","subscribers_url":"https://api.github.com/repos/sbinet/gonum-matrix/subscribers","subscription_url":"https://api.github.com/repos/sbinet/gonum-matrix/subscription","commits_url":"https://api.github.com/repos/sbinet/gonum-matrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbinet/gonum-matrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbinet/gonum-matrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbinet/gonum-matrix/contents/{+path}","compare_url":"https://api.github.com/repos/sbinet/gonum-matrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbinet/gonum-matrix/merges","archive_url":"https://api.github.com/repos/sbinet/gonum-matrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbinet/gonum-matrix/downloads","issues_url":"https://api.github.com/repos/sbinet/gonum-matrix/issues{/number}","pulls_url":"https://api.github.com/repos/sbinet/gonum-matrix/pulls{/number}","milestones_url":"https://api.github.com/repos/sbinet/gonum-matrix/milestones{/number}","notifications_url":"https://api.github.com/repos/sbinet/gonum-matrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbinet/gonum-matrix/labels{/name}","releases_url":"https://api.github.com/repos/sbinet/gonum-matrix/releases{/id}","deployments_url":"https://api.github.com/repos/sbinet/gonum-matrix/deployments","created_at":"2015-01-12T12:46:30Z","updated_at":"2016-01-15T20:50:08Z","pushed_at":"2016-03-12T15:44:25Z","git_url":"git://github.com/sbinet/gonum-matrix.git","ssh_url":"git@github.com:sbinet/gonum-matrix.git","clone_url":"https://github.com/sbinet/gonum-matrix.git","svn_url":"https://github.com/sbinet/gonum-matrix","homepage":null,"size":944,"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":"gonum:master","ref":"master","sha":"05edb4948f0b174984516cd4edd9cd04466f24d6","user":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":8569918,"name":"matrix","full_name":"gonum/matrix","owner":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gonum/matrix","description":"Matrix packages for the Go language.","fork":false,"url":"https://api.github.com/repos/gonum/matrix","forks_url":"https://api.github.com/repos/gonum/matrix/forks","keys_url":"https://api.github.com/repos/gonum/matrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gonum/matrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gonum/matrix/teams","hooks_url":"https://api.github.com/repos/gonum/matrix/hooks","issue_events_url":"https://api.github.com/repos/gonum/matrix/issues/events{/number}","events_url":"https://api.github.com/repos/gonum/matrix/events","assignees_url":"https://api.github.com/repos/gonum/matrix/assignees{/user}","branches_url":"https://api.github.com/repos/gonum/matrix/branches{/branch}","tags_url":"https://api.github.com/repos/gonum/matrix/tags","blobs_url":"https://api.github.com/repos/gonum/matrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gonum/matrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gonum/matrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/gonum/matrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gonum/matrix/statuses/{sha}","languages_url":"https://api.github.com/repos/gonum/matrix/languages","stargazers_url":"https://api.github.com/repos/gonum/matrix/stargazers","contributors_url":"https://api.github.com/repos/gonum/matrix/contributors","subscribers_url":"https://api.github.com/repos/gonum/matrix/subscribers","subscription_url":"https://api.github.com/repos/gonum/matrix/subscription","commits_url":"https://api.github.com/repos/gonum/matrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/gonum/matrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/gonum/matrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/gonum/matrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/gonum/matrix/contents/{+path}","compare_url":"https://api.github.com/repos/gonum/matrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gonum/matrix/merges","archive_url":"https://api.github.com/repos/gonum/matrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gonum/matrix/downloads","issues_url":"https://api.github.com/repos/gonum/matrix/issues{/number}","pulls_url":"https://api.github.com/repos/gonum/matrix/pulls{/number}","milestones_url":"https://api.github.com/repos/gonum/matrix/milestones{/number}","notifications_url":"https://api.github.com/repos/gonum/matrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gonum/matrix/labels{/name}","releases_url":"https://api.github.com/repos/gonum/matrix/releases{/id}","deployments_url":"https://api.github.com/repos/gonum/matrix/deployments","created_at":"2013-03-05T01:59:12Z","updated_at":"2016-03-08T17:34:00Z","pushed_at":"2016-03-12T15:03:02Z","git_url":"git://github.com/gonum/matrix.git","ssh_url":"git@github.com:gonum/matrix.git","clone_url":"https://github.com/gonum/matrix.git","svn_url":"https://github.com/gonum/matrix","homepage":"","size":1090,"stargazers_count":227,"watchers_count":227,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":19,"forks":33,"open_issues":19,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gonum/matrix/pulls/354"},"html":{"href":"https://github.com/gonum/matrix/pull/354"},"issue":{"href":"https://api.github.com/repos/gonum/matrix/issues/354"},"comments":{"href":"https://api.github.com/repos/gonum/matrix/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/gonum/matrix/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/gonum/matrix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gonum/matrix/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/gonum/matrix/statuses/a0b03e4ce91b61ca82aa1fc6dfc6711f6e43ab11"}}}}