Skip to content

Instantly share code, notes, and snippets.

@davecheney
Created June 2, 2013 12:29
Show Gist options
  • Select an option

  • Save davecheney/5693495 to your computer and use it in GitHub Desktop.

Select an option

Save davecheney/5693495 to your computer and use it in GitHub Desktop.
bytes: improved bytes.Equal for arm
Backport https://codereview.appspot.com/8056043/ to arm.
Work in progress
test/bench/go1:
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17 2147483647 2147483647 -6.77%
BenchmarkFannkuch11 2147483647 2147483647 -0.40%
BenchmarkFmtFprintfEmpty 477 450 -5.66%
BenchmarkFmtFprintfString 1267 1565 +23.52%
BenchmarkFmtFprintfInt 1053 959 -8.93%
BenchmarkFmtFprintfIntInt 1519 1424 -6.25%
BenchmarkFmtFprintfPrefixedInt 1635 1459 -10.76%
BenchmarkFmtFprintfFloat 3469 3414 -1.59%
BenchmarkFmtManyArgs 5216 5644 +8.21%
BenchmarkGobDecode 50783169 54360275 +7.04%
BenchmarkGobEncode 21561970 21482221 -0.37%
BenchmarkGzip 1977911167 1970060918 -0.40%
BenchmarkGunzip 307169333 310747742 +1.16%
BenchmarkHTTPClientServer 224916 218873 -2.69%
BenchmarkJSONEncode 243437841 257029133 +5.58%
BenchmarkJSONDecode 612851675 633904771 +3.44%
BenchmarkMandelbrot200 13087922 13117930 +0.23%
BenchmarkGoParse 21126881 21084011 -0.20%
BenchmarkRegexpMatchEasy0_32 574 568 -1.05%
BenchmarkRegexpMatchEasy0_1K 2623 2632 +0.34%
BenchmarkRegexpMatchEasy1_32 614 620 +0.98%
BenchmarkRegexpMatchEasy1_1K 4953 4893 -1.21%
BenchmarkRegexpMatchMedium_32 928 956 +3.02%
BenchmarkRegexpMatchMedium_1K 269017 268002 -0.38%
BenchmarkRegexpMatchHard_32 13288 13527 +1.80%
BenchmarkRegexpMatchHard_1K 408929 406709 -0.54%
BenchmarkRevcomp 44400821 42164364 -5.04%
BenchmarkTemplate 565993592 562832083 -0.56%
BenchmarkTimeParse 4342 4339 -0.07%
BenchmarkTimeFormat 5240 4684 -10.61%
benchmark old MB/s new MB/s speedup
BenchmarkGobDecode 15.11 14.12 0.93x
BenchmarkGobEncode 35.60 35.73 1.00x
BenchmarkGzip 9.81 9.85 1.00x
BenchmarkGunzip 63.17 62.45 0.99x
BenchmarkJSONEncode 7.97 7.55 0.95x
BenchmarkJSONDecode 3.17 3.06 0.97x
BenchmarkGoParse 2.74 2.75 1.00x
BenchmarkRegexpMatchEasy0_32 55.71 56.30 1.01x
BenchmarkRegexpMatchEasy0_1K 390.36 388.98 1.00x
BenchmarkRegexpMatchEasy1_32 52.12 51.61 0.99x
BenchmarkRegexpMatchEasy1_1K 206.71 209.24 1.01x
BenchmarkRegexpMatchMedium_32 1.08 1.05 0.97x
BenchmarkRegexpMatchMedium_1K 3.81 3.82 1.00x
BenchmarkRegexpMatchHard_32 2.41 2.37 0.98x
BenchmarkRegexpMatchHard_1K 2.50 2.52 1.01x
BenchmarkRevcomp 57.25 60.28 1.05x
BenchmarkTemplate 3.43 3.45 1.01x
bytes:
benchmark old ns/op new ns/op delta
BenchmarkReadString 107295 86293 -19.57%
BenchmarkBufferNotEmptyWriteRead 3737651 3706841 -0.82%
BenchmarkBufferFullSmallReads 458579 454206 -0.95%
BenchmarkIndexByte32 97 97 +0.72%
BenchmarkIndexByte4K 7315 7317 +0.03%
BenchmarkIndexByte4M 7577080 7602979 +0.34%
BenchmarkIndexByte64M 121161212 121192091 +0.03%
BenchmarkIndexBytePortable32 175 180 +2.86%
BenchmarkIndexBytePortable4K 17353 17369 +0.09%
BenchmarkIndexBytePortable4M 18336993 18401586 +0.35%
BenchmarkIndexBytePortable64M 292826225 294262350 +0.49%
BenchmarkEqual0 10 11 +14.42%
BenchmarkEqual1 35 14 -59.89%
BenchmarkEqual6 23 23 +0.42%
BenchmarkEqual9 49 21 -55.85%
BenchmarkEqual15 47 30 -36.02%
BenchmarkEqual16 49 22 -54.08%
BenchmarkEqual20 56 24 -56.68%
BenchmarkEqual32 77 43 -43.73%
BenchmarkEqual4K 7316 1855 -74.64%
BenchmarkEqual4M 8342653 2945350 -64.70%
BenchmarkEqual64M 141348712 59399785 -57.98%
BenchmarkEqualPort1 32 32 +0.31%
BenchmarkEqualPort6 86 87 +0.35%
BenchmarkEqualPort32 225 224 -0.44%
BenchmarkEqualPort4K 24362 24323 -0.16%
BenchmarkEqualPortable4M 25275980 25168768 -0.42%
BenchmarkEqualPortable64M 405716808 404174417 -0.38%
BenchmarkIndex32 804 835 +3.86%
BenchmarkIndex4K 119931 123548 +3.02%
BenchmarkIndex4M 122001387 127492570 +4.50%
BenchmarkIndex64M 1951776251 2040265126 +4.53%
BenchmarkIndexEasy32 167 156 -6.59%
BenchmarkIndexEasy4K 7384 7366 -0.24%
BenchmarkIndexEasy4M 7577542 7604907 +0.36%
BenchmarkIndexEasy64M 120940639 121247631 +0.25%
BenchmarkCount32 805 841 +4.47%
BenchmarkCount4K 118722 123889 +4.35%
BenchmarkCount4M 121604195 127775583 +5.07%
BenchmarkCount64M 1947324585 2046752544 +5.11%
BenchmarkCountEasy32 175 160 -8.57%
BenchmarkCountEasy4K 7367 7383 +0.22%
BenchmarkCountEasy4M 7548270 7591173 +0.57%
BenchmarkCountEasy64M 120646020 121004329 +0.30%
BenchmarkFields 115992679 116237795 +0.21%
BenchmarkFieldsFunc 114572389 115057154 +0.42%
BenchmarkTrimSpace 335 337 +0.60%
BenchmarkCompareBytesEqual 133 132 -0.75%
BenchmarkCompareBytesToNil 12 12 +0.00%
BenchmarkCompareBytesEmpty 12 12 +0.80%
BenchmarkCompareBytesIdentical 132 132 +0.00%
BenchmarkCompareBytesSameLength 58 58 -0.17%
BenchmarkCompareBytesDifferentLength 58 58 +0.00%
BenchmarkCompareBytesBigUnaligned 9152522 9191390 +0.42%
BenchmarkCompareBytesBig 9075587 9117289 +0.46%
BenchmarkCompareBytesBigIdentical 9224587 9195110 -0.32%
benchmark old MB/s new MB/s speedup
BenchmarkReadString 305.40 379.73 1.24x
BenchmarkIndexByte32 329.20 326.74 0.99x
BenchmarkIndexByte4K 559.93 559.77 1.00x
BenchmarkIndexByte4M 553.55 551.67 1.00x
BenchmarkIndexByte64M 553.88 553.74 1.00x
BenchmarkIndexBytePortable32 182.73 177.41 0.97x
BenchmarkIndexBytePortable4K 236.03 235.81 1.00x
BenchmarkIndexBytePortable4M 228.73 227.93 1.00x
BenchmarkIndexBytePortable64M 229.18 228.06 1.00x
BenchmarkEqual1 28.24 70.35 2.49x
BenchmarkEqual6 254.05 252.94 1.00x
BenchmarkEqual9 181.44 410.62 2.26x
BenchmarkEqual15 317.54 496.92 1.56x
BenchmarkEqual16 326.42 709.76 2.17x
BenchmarkEqual20 356.46 821.78 2.31x
BenchmarkEqual32 413.72 735.44 1.78x
BenchmarkEqual4K 559.83 2207.59 3.94x
BenchmarkEqual4M 502.75 1424.04 2.83x
BenchmarkEqual64M 474.78 1129.78 2.38x
BenchmarkEqualPort1 30.80 30.71 1.00x
BenchmarkEqualPort6 69.11 68.88 1.00x
BenchmarkEqualPort32 142.10 142.52 1.00x
BenchmarkEqualPort4K 168.13 168.39 1.00x
BenchmarkEqualPortable4M 165.94 166.65 1.00x
BenchmarkEqualPortable64M 165.41 166.04 1.00x
BenchmarkIndex32 39.79 38.32 0.96x
BenchmarkIndex4K 34.15 33.15 0.97x
BenchmarkIndex4M 34.38 32.90 0.96x
BenchmarkIndex64M 34.38 32.89 0.96x
BenchmarkIndexEasy32 190.64 204.73 1.07x
BenchmarkIndexEasy4K 554.68 556.00 1.00x
BenchmarkIndexEasy4M 553.52 551.53 1.00x
BenchmarkIndexEasy64M 554.89 553.49 1.00x
BenchmarkCount32 39.71 38.01 0.96x
BenchmarkCount4K 34.50 33.06 0.96x
BenchmarkCount4M 34.49 32.83 0.95x
BenchmarkCount64M 34.46 32.79 0.95x
BenchmarkCountEasy32 182.17 199.89 1.10x
BenchmarkCountEasy4K 555.95 554.76 1.00x
BenchmarkCountEasy4M 555.66 552.52 0.99x
BenchmarkCountEasy64M 556.25 554.60 1.00x
BenchmarkFields 9.04 9.02 1.00x
BenchmarkFieldsFunc 9.15 9.11 1.00x
BenchmarkCompareBytesBigUnaligned 114.57 114.08 1.00x
BenchmarkCompareBytesBig 115.54 115.01 1.00x
BenchmarkCompareBytesBigIdentical 113.67 114.04 1.00x
runtime:
benchmark old ns/op new ns/op delta
BenchmarkAppend 267 271 +1.50%
BenchmarkAppend1Byte 28 29 +1.39%
BenchmarkAppend4Bytes 33 34 +2.08%
BenchmarkAppend8Bytes 41 41 +0.00%
BenchmarkAppend16Bytes 37 38 +0.26%
BenchmarkAppend32Bytes 40 37 -8.60%
BenchmarkAppendStr1Byte 21 21 +0.00%
BenchmarkAppendStr4Bytes 28 28 +0.35%
BenchmarkAppendStr8Bytes 37 37 +0.00%
BenchmarkAppendStr16Bytes 36 36 -0.28%
BenchmarkAppendStr32Bytes 31 31 +0.32%
BenchmarkAppendSpecialCase 235 231 -1.70%
BenchmarkSelectUncontended 1198 1233 +2.92%
BenchmarkSelectContended 1212 1269 +4.70%
BenchmarkSelectNonblock 837 852 +1.79%
BenchmarkChanUncontended 499 508 +1.80%
BenchmarkChanContended 508 501 -1.38%
BenchmarkChanSync 963 967 +0.42%
BenchmarkChanProdCons0 1015 1064 +4.83%
BenchmarkChanProdCons10 641 650 +1.40%
BenchmarkChanProdCons100 510 519 +1.76%
BenchmarkChanProdConsWork0 2329 2369 +1.72%
BenchmarkChanProdConsWork10 1894 1921 +1.43%
BenchmarkChanProdConsWork100 1769 1779 +0.57%
BenchmarkChanCreation 973 978 +0.51%
BenchmarkChanSem 534 501 -6.18%
BenchmarkCallClosure 7 8 +7.49%
BenchmarkCallClosure1 13 10 -22.06%
BenchmarkCallClosure2 172 174 +1.16%
BenchmarkCallClosure3 205 183 -10.73%
BenchmarkCallClosure4 190 185 -2.63%
BenchmarkComplex128DivNormal 100 100 +0.00%
BenchmarkComplex128DivNisNaN 30 30 +0.00%
BenchmarkComplex128DivDisNaN 29 29 -0.68%
BenchmarkComplex128DivNisInf 26 26 +0.38%
BenchmarkComplex128DivDisInf 27 27 -0.36%
BenchmarkConvT2ESmall 32 32 +0.31%
BenchmarkConvT2EUintptr 7 7 +0.42%
BenchmarkConvT2ELarge 205 208 +1.46%
BenchmarkConvT2ISmall 95 98 +4.11%
BenchmarkConvT2IUintptr 7 7 +2.46%
BenchmarkConvT2ILarge 276 286 +3.62%
BenchmarkConvI2E 18 18 -0.54%
BenchmarkConvI2I 132 132 +0.00%
BenchmarkAssertE2T 28 27 -1.41%
BenchmarkAssertE2TLarge 33 33 +0.90%
BenchmarkAssertE2I 134 138 +2.99%
BenchmarkAssertI2T 28 32 +12.68%
BenchmarkAssertI2I 143 135 -5.59%
BenchmarkAssertI2E 17 16 -6.43%
BenchmarkAssertE2E 6 6 -0.31%
BenchmarkMalloc8 159 165 +3.77%
BenchmarkMalloc16 185 181 -2.16%
BenchmarkMallocTypeInfo8 234 230 -1.71%
BenchmarkMallocTypeInfo16 250 247 -1.20%
BenchmarkHashStringSpeed 318 350 +10.06%
BenchmarkHashBytesSpeed 676 768 +13.61%
BenchmarkHashInt32Speed 182 182 +0.00%
BenchmarkHashInt64Speed 311 311 +0.00%
BenchmarkHashStringArraySpeed 852 866 +1.64%
BenchmarkMegMap 74 73 -0.95%
BenchmarkMegOneMap 88 89 +1.47%
BenchmarkMegEqMap 2031618 742464 -63.45%
BenchmarkMegEmptyMap 9 9 +2.64%
BenchmarkSmallStrMap 78 78 +0.26%
BenchmarkMapStringKeysEight_16 70 76 +9.25%
BenchmarkMapStringKeysEight_32 73 73 -0.14%
BenchmarkMapStringKeysEight_64 71 72 +1.25%
BenchmarkMapStringKeysEight_1M 69 73 +6.38%
BenchmarkIntMap 59 60 +0.50%
BenchmarkRepeatedLookupStrMapKey32 910 906 -0.44%
BenchmarkRepeatedLookupStrMapKey1M 25231144 25136272 -0.38%
BenchmarkNewEmptyMap 418 416 -0.48%
BenchmarkMapIter 374 376 +0.53%
BenchmarkMapIterEmpty 10 9 -2.00%
BenchmarkMemmove0 9 9 +3.69%
BenchmarkMemmove1 20 20 +0.00%
BenchmarkMemmove2 26 26 +0.38%
BenchmarkMemmove3 27 27 +0.37%
BenchmarkMemmove4 27 27 +0.00%
BenchmarkMemmove5 29 29 +0.00%
BenchmarkMemmove6 31 31 +0.00%
BenchmarkMemmove7 33 33 +0.91%
BenchmarkMemmove8 31 29 -6.29%
BenchmarkMemmove9 32 32 +0.00%
BenchmarkMemmove10 34 34 +0.29%
BenchmarkMemmove11 36 36 +0.28%
BenchmarkMemmove12 31 31 +0.00%
BenchmarkMemmove13 34 35 +4.09%
BenchmarkMemmove14 36 37 +3.61%
BenchmarkMemmove15 38 38 +1.05%
BenchmarkMemmove16 32 32 +0.62%
BenchmarkMemmove32 30 30 +0.66%
BenchmarkMemmove64 32 32 +0.00%
BenchmarkMemmove128 40 40 +1.00%
BenchmarkMemmove256 61 62 +0.98%
BenchmarkMemmove512 126 126 +0.00%
BenchmarkMemmove1024 202 203 +0.50%
BenchmarkMemmove2048 375 374 -0.27%
BenchmarkMemmove4096 711 714 +0.42%
BenchmarkFinalizer 666 690 +3.60%
BenchmarkFinalizerRun 4208 4695 +11.57%
BenchmarkStackGrowth 4043 4219 +4.35%
BenchmarkStackGrowthDeep 468807 477078 +1.76%
BenchmarkSyscall 256 287 +12.11%
BenchmarkSyscallWork 673 686 +1.93%
BenchmarkSyscallExcess 258 265 +2.71%
BenchmarkSyscallExcessWork 673 686 +1.93%
BenchmarkCreateGoroutines 774 796 +2.84%
BenchmarkCreateGoroutinesParallel 775 796 +2.71%
BenchmarkMatmult 40 39 -3.70%
BenchmarkIfaceCmp100 502 500 -0.40%
BenchmarkIfaceCmpNil100 519 519 +0.00%
BenchmarkDefer 170 176 +3.53%
BenchmarkDefer10 150 149 -0.67%
BenchmarkDeferMany 284 288 +1.41%
BenchmarkCompareStringEqual 75 46 -38.20%
BenchmarkCompareStringIdentical 17 18 +2.82%
BenchmarkCompareStringSameLength 45 41 -8.57%
BenchmarkCompareStringDifferentLength 3 3 +1.69%
BenchmarkCompareStringBigUnaligned 2014275 904676 -55.09%
BenchmarkCompareStringBig 2054621 736085 -64.17%
BenchmarkUint32Div7 19 20 +1.01%
BenchmarkUint32Div37 20 20 +0.50%
BenchmarkUint32Div123 20 20 +0.00%
BenchmarkUint32Div763 20 20 +0.00%
BenchmarkUint32Div1247 20 20 +0.00%
BenchmarkUint32Div9305 20 20 +0.50%
BenchmarkUint32Div13307 20 20 +0.00%
BenchmarkUint32Div52513 21 20 -4.29%
BenchmarkUint32Div60978747 20 20 +0.00%
BenchmarkUint32Div106956295 20 20 +0.00%
BenchmarkUint32Mod7 20 21 +6.50%
BenchmarkUint32Mod37 21 21 +0.93%
BenchmarkUint32Mod123 20 20 +0.50%
BenchmarkUint32Mod763 20 20 +0.50%
BenchmarkUint32Mod1247 20 20 +1.00%
BenchmarkUint32Mod9305 19 20 +1.51%
BenchmarkUint32Mod13307 19 20 +1.51%
BenchmarkUint32Mod52513 20 20 +0.50%
BenchmarkUint32Mod60978747 20 20 +1.00%
BenchmarkUint32Mod106956295 20 20 +0.50%
benchmark old MB/s new MB/s speedup
BenchmarkMemmove1 47.89 47.75 1.00x
BenchmarkMemmove2 75.25 74.85 0.99x
BenchmarkMemmove3 110.38 109.97 1.00x
BenchmarkMemmove4 144.05 143.71 1.00x
BenchmarkMemmove5 169.18 169.04 1.00x
BenchmarkMemmove6 191.70 191.44 1.00x
BenchmarkMemmove7 211.32 209.73 0.99x
BenchmarkMemmove8 251.60 268.72 1.07x
BenchmarkMemmove9 277.12 276.54 1.00x
BenchmarkMemmove10 292.09 291.34 1.00x
BenchmarkMemmove11 305.48 304.41 1.00x
BenchmarkMemmove12 383.59 383.46 1.00x
BenchmarkMemmove13 379.66 365.48 0.96x
BenchmarkMemmove14 388.62 375.45 0.97x
BenchmarkMemmove15 393.18 388.84 0.99x
BenchmarkMemmove16 497.94 495.12 0.99x
BenchmarkMemmove32 1063.01 1056.66 0.99x
BenchmarkMemmove64 1962.44 1963.19 1.00x
BenchmarkMemmove128 3188.05 3160.67 0.99x
BenchmarkMemmove256 4169.77 4127.39 0.99x
BenchmarkMemmove512 4049.36 4037.05 1.00x
BenchmarkMemmove1024 5065.38 5037.35 0.99x
BenchmarkMemmove2048 5460.27 5472.50 1.00x
BenchmarkMemmove4096 5754.76 5736.46 1.00x
BenchmarkCompareStringBigUnaligned 520.58 1159.07 2.23x
BenchmarkCompareStringBig 510.35 1424.54 2.79x
benchmark old allocs new allocs delta
BenchmarkNewEmptyMap 1 1 0.00%
benchmark old bytes new bytes delta
BenchmarkNewEmptyMap 33 33 0.00%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment