{"action":"created","issue":{"url":"https://api.github.com/repos/dominictarr/sha.js/issues/18","labels_url":"https://api.github.com/repos/dominictarr/sha.js/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/dominictarr/sha.js/issues/18/comments","events_url":"https://api.github.com/repos/dominictarr/sha.js/issues/18/events","html_url":"https://github.com/dominictarr/sha.js/pull/18","id":54032209,"number":18,"title":"SHA1 optimization","user":{"login":"dcousens","id":413395,"avatar_url":"https://avatars.githubusercontent.com/u/413395?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousens","html_url":"https://github.com/dcousens","followers_url":"https://api.github.com/users/dcousens/followers","following_url":"https://api.github.com/users/dcousens/following{/other_user}","gists_url":"https://api.github.com/users/dcousens/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousens/subscriptions","organizations_url":"https://api.github.com/users/dcousens/orgs","repos_url":"https://api.github.com/users/dcousens/repos","events_url":"https://api.github.com/users/dcousens/events{/privacy}","received_events_url":"https://api.github.com/users/dcousens/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-12T09:09:18Z","updated_at":"2015-01-13T01:54:31Z","closed_at":"2015-01-12T19:11:07Z","pull_request":{"url":"https://api.github.com/repos/dominictarr/sha.js/pulls/18","html_url":"https://github.com/dominictarr/sha.js/pull/18","diff_url":"https://github.com/dominictarr/sha.js/pull/18.diff","patch_url":"https://github.com/dominictarr/sha.js/pull/18.patch"},"body":"This pull request unpacks the loops in SHA1 such that no branches exist, improving performance by about ~~16 to 20%~~ >20%.\r\n\r\nThe loops haven't been entirely unrolled, as it would likely inhibit readability so severely with [likely] little gain.\r\n\r\n``` javascript\r\nrun (N), input-size (bytes), ops (bytes/ms), time (ms)\r\n1, 1, 34.47, 0.02901073397156948\r\n3, 2, 89.8, 0.022271714922048998\r\n5, 3, 139.65, 0.021482277121374866\r\n7, 4, 174.88, 0.022872827081427266\r\n8, 5, 217.9, 0.02294630564479119\r\n9, 6, 322.38, 0.018611576400521124\r\n10, 7, 345.38, 0.020267531414673693\r\n11, 9, 411.3, 0.02188183807439825\r\n12, 11, 475.53, 0.023132084200786492\r\n13, 14, 571.76, 0.024485798237022526\r\n14, 17, 750.04, 0.022665457842248413\r\n15, 21, 1062.81, 0.019758940920766646\r\n16, 25, 1193.25, 0.020951183741881416\r\n17, 31, 1535.74, 0.020185708518368994\r\n18, 38, 1576.24, 0.024108003857280617\r\n19, 46, 2346, 0.0196078431372549\r\n20, 56, 1538.32, 0.03640334910811795\r\n21, 69, 1693.95, 0.04073319755600815\r\n22, 84, 1973.16, 0.04257130693912303\r\n23, 103, 2579.12, 0.039936102236421724\r\n24, 126, 2125.62, 0.05927682276229994\r\n25, 154, 2610.3, 0.058997050147492625\r\n26, 188, 2498.52, 0.07524454477050414\r\n27, 230, 3059, 0.07518796992481203\r\n28, 282, 3262.74, 0.08643042350907519\r\n29, 345, 3588, 0.09615384615384616\r\n30, 422, 3422.42, 0.12330456226880394\r\n31, 516, 3008.28, 0.17152658662092624\r\n32, 631, 3672.42, 0.1718213058419244\r\n33, 772, 4184.24, 0.18450184501845018\r\n34, 944, 3624.96, 0.2604166666666667\r\n35, 1155, 3915.45, 0.2949852507374631\r\n36, 1413, 3716.19, 0.38022813688212925\r\n37, 1728, 3749.76, 0.4608294930875576\r\n38, 2113, 4395.04, 0.4807692307692308\r\n39, 2585, 3877.5, 0.6666666666666666\r\n40, 3162, 3857.64, 0.819672131147541\r\n41, 3868, 3906.68, 0.9900990099009901\r\n42, 4732, 3927.56, 1.2048192771084338\r\n43, 5788, 5556.48, 1.0416666666666667\r\n44, 7079, 3995.079207920792, 1.7719298245614035\r\n45, 8660, 3983.6, 2.1739130434782608\r\n46, 10593, 3985.4851485148515, 2.6578947368421053\r\n47, 12957, 4016.67, 3.225806451612903\r\n48, 15849, 4279.23, 3.7037037037037037\r\n49, 19387, 3991.4411764705883, 4.857142857142857\r\n50, 23714, 3952.3333333333335, 6\r\n51, 29007, 3904.7884615384614, 7.428571428571429\r\n52, 35481, 4133.708737864078, 8.583333333333334\r\n53, 43401, 5477.796116504855, 7.923076923076923\r\n54, 53088, 4247.04, 12.5\r\n55, 64938, 4370.826923076923, 14.857142857142858\r\n56, 79433, 4217.6814159292035, 18.833333333333332\r\n57, 97163, 4337.633928571428, 22.4\r\n58, 118850, 4401.851851851852, 27\r\n59, 145378, 4076.0186915887853, 35.666666666666664\r\n60, 177828, 4521.050847457627, 39.333333333333336\r\n61, 217520, 4104.1509433962265, 53\r\n62, 266073, 4927.277777777777, 54\r\n63, 325462, 4520.305555555556, 72\r\n64, 398107, 4767.748502994012, 83.5\r\n65, 486968, 4234.504347826087, 115\r\n66, 595662, 4445.238805970149, 134\r\n67, 728618, 4670.628205128205, 156\r\n68, 891251, 4594.077319587629, 194\r\n69, 1090184, 5023.889400921659, 217\r\n70, 1333521, 5148.72972972973, 259\r\n71, 1631173, 5605.405498281787, 291\r\n72, 1995262, 5334.92513368984, 374\r\n73, 2440619, 5423.597777777778, 450\r\n74, 2985383, 5497.942909760589, 543\r\n75, 3651741, 5516.2250755287005, 662\r\n76, 4466836, 5604.562107904642, 797\r\n77, 5463865, 5644.488636363636, 968\r\n78, 6683439, 5683.196428571428, 1176\r\n79, 8175230, 5712.948986722572, 1431\r\n80, 10000000, 5763.688760806916, 1735\r\n```"},"comment":{"url":"https://api.github.com/repos/dominictarr/sha.js/issues/comments/69682826","html_url":"https://github.com/dominictarr/sha.js/pull/18#issuecomment-69682826","issue_url":"https://api.github.com/repos/dominictarr/sha.js/issues/18","id":69682826,"user":{"login":"dcousens","id":413395,"avatar_url":"https://avatars.githubusercontent.com/u/413395?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousens","html_url":"https://github.com/dcousens","followers_url":"https://api.github.com/users/dcousens/followers","following_url":"https://api.github.com/users/dcousens/following{/other_user}","gists_url":"https://api.github.com/users/dcousens/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousens/subscriptions","organizations_url":"https://api.github.com/users/dcousens/orgs","repos_url":"https://api.github.com/users/dcousens/repos","events_url":"https://api.github.com/users/dcousens/events{/privacy}","received_events_url":"https://api.github.com/users/dcousens/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T01:54:31Z","updated_at":"2015-01-13T01:54:31Z","body":"``` javascript\r\n* b044c10 (HEAD, parent/master) 2.3.4\r\n*   a454744 Merge branch 'shaopt' of https://github.com/dcousens/sha.js\r\n|\\\r\n| * 26a75ec (origin/shaopt, shaopt) sha1: use a closure over separate loops\r\n* | d7c1638 2.3.3\r\n* | bf46619 sha1: use a closure over seperate loops\r\n|/\r\n* f830142 sha1: unroll conditionals\r\n```\r\n\r\nNot the prettiest merge, and it clearly shows me fixing the spelling mistake in bf46619 haha."}}