{"action":"created","comment":{"url":"https://api.github.com/repos/dlang/phobos/pulls/comments/144733159","pull_request_review_id":69430915,"id":144733159,"diff_hunk":"@@ -1402,59 +1402,76 @@ void mulInternal(BigDigit[] result, const(BigDigit)[] x, const(BigDigit)[] y)\n         auto extra =  x.length % y.length;\n         auto maxchunk = chunksize + extra;\n         bool paddingY; // true = we're padding Y, false = we're padding X.\n-        if (extra * extra * 2 < y.length*y.length)\n-        {\n-            // The leftover bit is small enough that it should be incorporated\n-            // in the existing chunks.\n-            // Make all the chunks a tiny bit bigger\n-            // (We're padding y with zeros)\n-            chunksize += extra / numchunks;\n-            extra = x.length - chunksize*numchunks;\n-            // there will probably be a few left over.\n-            // Every chunk will either have size chunksize, or chunksize+1.\n-            maxchunk = chunksize + 1;\n-            paddingY = true;\n-            assert(chunksize + extra + chunksize *(numchunks-1) == x.length );\n+        bool isExtraSmall = extra * extra * 2 < y.length * y.length;\n+        if (numchunks == 1 && isExtraSmall)\n+        {\n+            // We divide (x_first_half * y) and (x_last_half * y)\n+            // between 1.414:1 and 1.707:1 (1.707 = 1+1/sqrt(2)).\n+            // (1.414 ~ 1.707)/2:1 is balanced.\n+            BigDigit [] scratchbuff = new BigDigit[karatsubaRequiredBuffSize(y.length) + y.length];\n+            BigDigit [] partial = scratchbuff[$ - y.length .. $];\n+            mulKaratsuba(result[0 .. half + y.length], y, x[0 .. half], scratchbuff);\n+            partial[] = result[half .. half + y.length];\n+            mulKaratsuba(result[half .. $], y, x[half .. $], scratchbuff);\n+            addAssignSimple(result[half .. half + y.length], partial);","path":"std/internal/math/biguintcore.d","position":28,"original_position":28,"commit_id":"93ee606fba69390b2f9ef7d77e43abc02b82cd19","original_commit_id":"93ee606fba69390b2f9ef7d77e43abc02b82cd19","user":{"login":"MartinNowak","id":288976,"avatar_url":"https://avatars0.githubusercontent.com/u/288976?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinNowak","html_url":"https://github.com/MartinNowak","followers_url":"https://api.github.com/users/MartinNowak/followers","following_url":"https://api.github.com/users/MartinNowak/following{/other_user}","gists_url":"https://api.github.com/users/MartinNowak/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinNowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinNowak/subscriptions","organizations_url":"https://api.github.com/users/MartinNowak/orgs","repos_url":"https://api.github.com/users/MartinNowak/repos","events_url":"https://api.github.com/users/MartinNowak/events{/privacy}","received_events_url":"https://api.github.com/users/MartinNowak/received_events","type":"User","site_admin":false},"body":"This looks structurally very similar to the variant below, any chance this could be integrated there?","created_at":"2017-10-15T21:50:21Z","updated_at":"2017-10-15T21:51:23Z","html_url":"https://github.com/dlang/phobos/pull/5715#discussion_r144733159","pull_request_url":"https://api.github.com/repos/dlang/phobos/pulls/5715","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dlang/phobos/pulls/comments/144733159"},"html":{"href":"https://github.com/dlang/phobos/pull/5715#discussion_r144733159"},"pull_request":{"href":"https://api.github.com/repos/dlang/phobos/pulls/5715"}}},"pull_request":{"url":"https://api.github.com/repos/dlang/phobos/pulls/5715","id":138649809,"html_url":"https://github.com/dlang/phobos/pull/5715","diff_url":"https://github.com/dlang/phobos/pull/5715.diff","patch_url":"https://github.com/dlang/phobos/pull/5715.patch","issue_url":"https://api.github.com/repos/dlang/phobos/issues/5715","number":5715,"state":"open","locked":false,"title":"Fix Issue 16264(+11599) - BigInt multiplication crashes on 64-bit","user":{"login":"yosupo06","id":7629145,"avatar_url":"https://avatars0.githubusercontent.com/u/7629145?v=4","gravatar_id":"","url":"https://api.github.com/users/yosupo06","html_url":"https://github.com/yosupo06","followers_url":"https://api.github.com/users/yosupo06/followers","following_url":"https://api.github.com/users/yosupo06/following{/other_user}","gists_url":"https://api.github.com/users/yosupo06/gists{/gist_id}","starred_url":"https://api.github.com/users/yosupo06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosupo06/subscriptions","organizations_url":"https://api.github.com/users/yosupo06/orgs","repos_url":"https://api.github.com/users/yosupo06/repos","events_url":"https://api.github.com/users/yosupo06/events{/privacy}","received_events_url":"https://api.github.com/users/yosupo06/received_events","type":"User","site_admin":false},"body":"https://gist.github.com/yosupo06/03bc48477049c8ac094a242bee511d0d#file-a-d : Stress test code\r\n","created_at":"2017-08-31T12:05:41Z","updated_at":"2017-10-15T21:51:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f252f2dc0b0400844913c9dde41b8e712f2737b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dlang/phobos/pulls/5715/commits","review_comments_url":"https://api.github.com/repos/dlang/phobos/pulls/5715/comments","review_comment_url":"https://api.github.com/repos/dlang/phobos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/phobos/issues/5715/comments","statuses_url":"https://api.github.com/repos/dlang/phobos/statuses/93ee606fba69390b2f9ef7d77e43abc02b82cd19","head":{"label":"yosupo06:Issue_16264","ref":"Issue_16264","sha":"93ee606fba69390b2f9ef7d77e43abc02b82cd19","user":{"login":"yosupo06","id":7629145,"avatar_url":"https://avatars0.githubusercontent.com/u/7629145?v=4","gravatar_id":"","url":"https://api.github.com/users/yosupo06","html_url":"https://github.com/yosupo06","followers_url":"https://api.github.com/users/yosupo06/followers","following_url":"https://api.github.com/users/yosupo06/following{/other_user}","gists_url":"https://api.github.com/users/yosupo06/gists{/gist_id}","starred_url":"https://api.github.com/users/yosupo06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosupo06/subscriptions","organizations_url":"https://api.github.com/users/yosupo06/orgs","repos_url":"https://api.github.com/users/yosupo06/repos","events_url":"https://api.github.com/users/yosupo06/events{/privacy}","received_events_url":"https://api.github.com/users/yosupo06/received_events","type":"User","site_admin":false},"repo":{"id":101929715,"name":"phobos","full_name":"yosupo06/phobos","owner":{"login":"yosupo06","id":7629145,"avatar_url":"https://avatars0.githubusercontent.com/u/7629145?v=4","gravatar_id":"","url":"https://api.github.com/users/yosupo06","html_url":"https://github.com/yosupo06","followers_url":"https://api.github.com/users/yosupo06/followers","following_url":"https://api.github.com/users/yosupo06/following{/other_user}","gists_url":"https://api.github.com/users/yosupo06/gists{/gist_id}","starred_url":"https://api.github.com/users/yosupo06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosupo06/subscriptions","organizations_url":"https://api.github.com/users/yosupo06/orgs","repos_url":"https://api.github.com/users/yosupo06/repos","events_url":"https://api.github.com/users/yosupo06/events{/privacy}","received_events_url":"https://api.github.com/users/yosupo06/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yosupo06/phobos","description":"The standard library of the D programming language","fork":true,"url":"https://api.github.com/repos/yosupo06/phobos","forks_url":"https://api.github.com/repos/yosupo06/phobos/forks","keys_url":"https://api.github.com/repos/yosupo06/phobos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yosupo06/phobos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yosupo06/phobos/teams","hooks_url":"https://api.github.com/repos/yosupo06/phobos/hooks","issue_events_url":"https://api.github.com/repos/yosupo06/phobos/issues/events{/number}","events_url":"https://api.github.com/repos/yosupo06/phobos/events","assignees_url":"https://api.github.com/repos/yosupo06/phobos/assignees{/user}","branches_url":"https://api.github.com/repos/yosupo06/phobos/branches{/branch}","tags_url":"https://api.github.com/repos/yosupo06/phobos/tags","blobs_url":"https://api.github.com/repos/yosupo06/phobos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yosupo06/phobos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yosupo06/phobos/git/refs{/sha}","trees_url":"https://api.github.com/repos/yosupo06/phobos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yosupo06/phobos/statuses/{sha}","languages_url":"https://api.github.com/repos/yosupo06/phobos/languages","stargazers_url":"https://api.github.com/repos/yosupo06/phobos/stargazers","contributors_url":"https://api.github.com/repos/yosupo06/phobos/contributors","subscribers_url":"https://api.github.com/repos/yosupo06/phobos/subscribers","subscription_url":"https://api.github.com/repos/yosupo06/phobos/subscription","commits_url":"https://api.github.com/repos/yosupo06/phobos/commits{/sha}","git_commits_url":"https://api.github.com/repos/yosupo06/phobos/git/commits{/sha}","comments_url":"https://api.github.com/repos/yosupo06/phobos/comments{/number}","issue_comment_url":"https://api.github.com/repos/yosupo06/phobos/issues/comments{/number}","contents_url":"https://api.github.com/repos/yosupo06/phobos/contents/{+path}","compare_url":"https://api.github.com/repos/yosupo06/phobos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yosupo06/phobos/merges","archive_url":"https://api.github.com/repos/yosupo06/phobos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yosupo06/phobos/downloads","issues_url":"https://api.github.com/repos/yosupo06/phobos/issues{/number}","pulls_url":"https://api.github.com/repos/yosupo06/phobos/pulls{/number}","milestones_url":"https://api.github.com/repos/yosupo06/phobos/milestones{/number}","notifications_url":"https://api.github.com/repos/yosupo06/phobos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yosupo06/phobos/labels{/name}","releases_url":"https://api.github.com/repos/yosupo06/phobos/releases{/id}","deployments_url":"https://api.github.com/repos/yosupo06/phobos/deployments","created_at":"2017-08-30T21:18:05Z","updated_at":"2017-08-30T21:18:10Z","pushed_at":"2017-08-31T12:00:58Z","git_url":"git://github.com/yosupo06/phobos.git","ssh_url":"git@github.com:yosupo06/phobos.git","clone_url":"https://github.com/yosupo06/phobos.git","svn_url":"https://github.com/yosupo06/phobos","homepage":"dlang.org/phobos","size":44429,"stargazers_count":0,"watchers_count":0,"language":"D","has_issues":false,"has_projects":true,"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":"dlang:stable","ref":"stable","sha":"694d87fe02f9ca062e89d7434651b8f6cc59f912","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1257084,"name":"phobos","full_name":"dlang/phobos","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/phobos","description":"The standard library of the D programming language","fork":false,"url":"https://api.github.com/repos/dlang/phobos","forks_url":"https://api.github.com/repos/dlang/phobos/forks","keys_url":"https://api.github.com/repos/dlang/phobos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/phobos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/phobos/teams","hooks_url":"https://api.github.com/repos/dlang/phobos/hooks","issue_events_url":"https://api.github.com/repos/dlang/phobos/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/phobos/events","assignees_url":"https://api.github.com/repos/dlang/phobos/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/phobos/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/phobos/tags","blobs_url":"https://api.github.com/repos/dlang/phobos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/phobos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/phobos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/phobos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/phobos/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/phobos/languages","stargazers_url":"https://api.github.com/repos/dlang/phobos/stargazers","contributors_url":"https://api.github.com/repos/dlang/phobos/contributors","subscribers_url":"https://api.github.com/repos/dlang/phobos/subscribers","subscription_url":"https://api.github.com/repos/dlang/phobos/subscription","commits_url":"https://api.github.com/repos/dlang/phobos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/phobos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/phobos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/phobos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/phobos/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/phobos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/phobos/merges","archive_url":"https://api.github.com/repos/dlang/phobos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/phobos/downloads","issues_url":"https://api.github.com/repos/dlang/phobos/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/phobos/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/phobos/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/phobos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/phobos/labels{/name}","releases_url":"https://api.github.com/repos/dlang/phobos/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/phobos/deployments","created_at":"2011-01-15T07:00:06Z","updated_at":"2017-10-04T08:37:10Z","pushed_at":"2017-10-15T14:19:51Z","git_url":"git://github.com/dlang/phobos.git","ssh_url":"git@github.com:dlang/phobos.git","clone_url":"https://github.com/dlang/phobos.git","svn_url":"https://github.com/dlang/phobos","homepage":"dlang.org/phobos","size":44804,"stargazers_count":840,"watchers_count":840,"language":"D","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":560,"mirror_url":null,"open_issues_count":108,"forks":560,"open_issues":108,"watchers":840,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/phobos/pulls/5715"},"html":{"href":"https://github.com/dlang/phobos/pull/5715"},"issue":{"href":"https://api.github.com/repos/dlang/phobos/issues/5715"},"comments":{"href":"https://api.github.com/repos/dlang/phobos/issues/5715/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/phobos/pulls/5715/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/phobos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/phobos/pulls/5715/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/phobos/statuses/93ee606fba69390b2f9ef7d77e43abc02b82cd19"}},"author_association":"NONE"}}
{"actor":{"display_login":"MartinNowak"}}