{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/85190389","pull_request_review_id":5919973,"id":85190389,"diff_hunk":"@@ -479,6 +479,53 @@ end\n     end\n end\n \n+# accumulate_pairwise is on the order of 50% slower then accumulate, but more numerically\n+# stable in certain situtations (e.g. sums)\n+function _accumulate_pairwise!{T}(op, c::AbstractVector{T}, v::AbstractVector, s, i1, n)\n+    local s_::T # for sum(v[range(i1,n)]), i.e. sum without s\n+    @inbounds if n < 128\n+        s_ = v[i1]\n+        c[i1] = op(s, s_)\n+        for i = i1+1:i1+n-1\n+            s_ = op(s_, v[i])\n+            c[i] = op(s, s_)\n+        end\n+    else\n+        n2 = n >> 1\n+        s_ = _accumulate_pairwise!(op, c, v, s, i1, n2)\n+        s_ = op(s_, _accumulate_pairwise!(op, c, v, op(s, s_), i1+n2, n-n2))\n+    end\n+    return s_\n+end\n+\n+function accumulate_pairwise!(op, result::AbstractVector, v::AbstractVector)","path":"base/multidimensional.jl","position":null,"original_position":23,"commit_id":"8a6e971b1e7a2d9aa64afddf3be1bdee5d0f9bb4","original_commit_id":"0929f08206299196d9cfeaab80c8635f575dcb99","user":{"login":"jw3126","id":7261506,"avatar_url":"https://avatars.githubusercontent.com/u/7261506?v=3","gravatar_id":"","url":"https://api.github.com/users/jw3126","html_url":"https://github.com/jw3126","followers_url":"https://api.github.com/users/jw3126/followers","following_url":"https://api.github.com/users/jw3126/following{/other_user}","gists_url":"https://api.github.com/users/jw3126/gists{/gist_id}","starred_url":"https://api.github.com/users/jw3126/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jw3126/subscriptions","organizations_url":"https://api.github.com/users/jw3126/orgs","repos_url":"https://api.github.com/users/jw3126/repos","events_url":"https://api.github.com/users/jw3126/events{/privacy}","received_events_url":"https://api.github.com/users/jw3126/received_events","type":"User","site_admin":false},"body":"I had only one allocation even without `op::F`, not sure why? I added the type annotation to `_accumulate_pairwise!` anyway however.","created_at":"2016-10-26T18:34:19Z","updated_at":"2016-10-26T18:34:19Z","html_url":"https://github.com/JuliaLang/julia/pull/18931#discussion_r85190389","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/18931","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/85190389"},"html":{"href":"https://github.com/JuliaLang/julia/pull/18931#discussion_r85190389"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/18931"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/18931","id":89432964,"html_url":"https://github.com/JuliaLang/julia/pull/18931","diff_url":"https://github.com/JuliaLang/julia/pull/18931.diff","patch_url":"https://github.com/JuliaLang/julia/pull/18931.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/18931","number":18931,"state":"open","locked":false,"title":"Added accumulate, accumulate!","user":{"login":"jw3126","id":7261506,"avatar_url":"https://avatars.githubusercontent.com/u/7261506?v=3","gravatar_id":"","url":"https://api.github.com/users/jw3126","html_url":"https://github.com/jw3126","followers_url":"https://api.github.com/users/jw3126/followers","following_url":"https://api.github.com/users/jw3126/following{/other_user}","gists_url":"https://api.github.com/users/jw3126/gists{/gist_id}","starred_url":"https://api.github.com/users/jw3126/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jw3126/subscriptions","organizations_url":"https://api.github.com/users/jw3126/orgs","repos_url":"https://api.github.com/users/jw3126/repos","events_url":"https://api.github.com/users/jw3126/events{/privacy}","received_events_url":"https://api.github.com/users/jw3126/received_events","type":"User","site_admin":false},"body":"Added accumulate, accumulate! see  #14730.","created_at":"2016-10-14T18:33:53Z","updated_at":"2016-10-26T18:34:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0789ea69449e394ee1d96a12abd5e3ff8f78221","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/18931/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/18931/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/18931/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/8a6e971b1e7a2d9aa64afddf3be1bdee5d0f9bb4","head":{"label":"jw3126:scan","ref":"scan","sha":"8a6e971b1e7a2d9aa64afddf3be1bdee5d0f9bb4","user":{"login":"jw3126","id":7261506,"avatar_url":"https://avatars.githubusercontent.com/u/7261506?v=3","gravatar_id":"","url":"https://api.github.com/users/jw3126","html_url":"https://github.com/jw3126","followers_url":"https://api.github.com/users/jw3126/followers","following_url":"https://api.github.com/users/jw3126/following{/other_user}","gists_url":"https://api.github.com/users/jw3126/gists{/gist_id}","starred_url":"https://api.github.com/users/jw3126/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jw3126/subscriptions","organizations_url":"https://api.github.com/users/jw3126/orgs","repos_url":"https://api.github.com/users/jw3126/repos","events_url":"https://api.github.com/users/jw3126/events{/privacy}","received_events_url":"https://api.github.com/users/jw3126/received_events","type":"User","site_admin":false},"repo":{"id":53058482,"name":"julia","full_name":"jw3126/julia","owner":{"login":"jw3126","id":7261506,"avatar_url":"https://avatars.githubusercontent.com/u/7261506?v=3","gravatar_id":"","url":"https://api.github.com/users/jw3126","html_url":"https://github.com/jw3126","followers_url":"https://api.github.com/users/jw3126/followers","following_url":"https://api.github.com/users/jw3126/following{/other_user}","gists_url":"https://api.github.com/users/jw3126/gists{/gist_id}","starred_url":"https://api.github.com/users/jw3126/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jw3126/subscriptions","organizations_url":"https://api.github.com/users/jw3126/orgs","repos_url":"https://api.github.com/users/jw3126/repos","events_url":"https://api.github.com/users/jw3126/events{/privacy}","received_events_url":"https://api.github.com/users/jw3126/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jw3126/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/jw3126/julia","forks_url":"https://api.github.com/repos/jw3126/julia/forks","keys_url":"https://api.github.com/repos/jw3126/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jw3126/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jw3126/julia/teams","hooks_url":"https://api.github.com/repos/jw3126/julia/hooks","issue_events_url":"https://api.github.com/repos/jw3126/julia/issues/events{/number}","events_url":"https://api.github.com/repos/jw3126/julia/events","assignees_url":"https://api.github.com/repos/jw3126/julia/assignees{/user}","branches_url":"https://api.github.com/repos/jw3126/julia/branches{/branch}","tags_url":"https://api.github.com/repos/jw3126/julia/tags","blobs_url":"https://api.github.com/repos/jw3126/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jw3126/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jw3126/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/jw3126/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jw3126/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/jw3126/julia/languages","stargazers_url":"https://api.github.com/repos/jw3126/julia/stargazers","contributors_url":"https://api.github.com/repos/jw3126/julia/contributors","subscribers_url":"https://api.github.com/repos/jw3126/julia/subscribers","subscription_url":"https://api.github.com/repos/jw3126/julia/subscription","commits_url":"https://api.github.com/repos/jw3126/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/jw3126/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/jw3126/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/jw3126/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/jw3126/julia/contents/{+path}","compare_url":"https://api.github.com/repos/jw3126/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jw3126/julia/merges","archive_url":"https://api.github.com/repos/jw3126/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jw3126/julia/downloads","issues_url":"https://api.github.com/repos/jw3126/julia/issues{/number}","pulls_url":"https://api.github.com/repos/jw3126/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/jw3126/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/jw3126/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jw3126/julia/labels{/name}","releases_url":"https://api.github.com/repos/jw3126/julia/releases{/id}","deployments_url":"https://api.github.com/repos/jw3126/julia/deployments","created_at":"2016-03-03T14:53:05Z","updated_at":"2016-03-03T14:53:11Z","pushed_at":"2016-10-25T19:30:16Z","git_url":"git://github.com/jw3126/julia.git","ssh_url":"git@github.com:jw3126/julia.git","clone_url":"https://github.com/jw3126/julia.git","svn_url":"https://github.com/jw3126/julia","homepage":"http://julialang.org/","size":99172,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"JuliaLang:master","ref":"master","sha":"6c9f5afa89f451bf2262af6f2bdd87b7b7a328d4","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaLang/julia/deployments","created_at":"2011-04-21T07:01:50Z","updated_at":"2016-10-26T16:53:53Z","pushed_at":"2016-10-26T18:33:40Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":429928,"stargazers_count":7730,"watchers_count":7730,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1817,"mirror_url":null,"open_issues_count":2132,"forks":1817,"open_issues":2132,"watchers":7730,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/18931"},"html":{"href":"https://github.com/JuliaLang/julia/pull/18931"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/18931"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/18931/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/18931/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/18931/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/8a6e971b1e7a2d9aa64afddf3be1bdee5d0f9bb4"}}}}
{"actor":{"display_login":"jw3126"}}