gonum / internal

Internal routines for the gonum project [DEPRECATED]
21 stars 9 forks source link

Add noasm build tag #4

Closed kortschak closed 9 years ago

kortschak commented 9 years ago

This allows easy benchmarking against the pure pure Go implementation and also provides a way to easily assess compiler improvements.

e.g.

$ cd $GOPATH/src/github.com/gonum/blas/native
$ go test -bench . > asm.txt
$ go test -tags noasm -bench . > noasm.txt
$ benchcmp noasm.txt asm.txt
kortschak commented 9 years ago

PTAL @fhs

Please rebase this onto #3 when this is merged.

fhs commented 9 years ago

LGTM

kortschak commented 9 years ago

The results of the benchmark above:

$ benchcmp noasm.txt asm.txt
benchmark                                 old ns/op      new ns/op      delta
BenchmarkDgemmSmSmSm                      3151           3201           +1.59%
BenchmarkDgemmMedMedMed                   1552714        1599001        +2.98%
BenchmarkDgemmMedLgMed                    15400186       15460791       +0.39%
BenchmarkDgemmLgLgLg                      1561190006     1574139140     +0.83%
BenchmarkDgemmLgSmLg                      19981103       20461116       +2.40%
BenchmarkDgemmLgLgSm                      19909264       20265736       +1.79%
BenchmarkDgemmHgHgSm                      2007651714     1989973163     -0.88%
BenchmarkDgemmMedMedMedTNT                1895163        1876528        -0.98%
BenchmarkDgemmMedMedMedNTT                1534763        1533025        -0.11%
BenchmarkDgemmMedMedMedNTNT               1598422        1581741        -1.04%
BenchmarkDgemvSmSmNoTransInc1             239            234            -2.09%
BenchmarkDgemvSmSmNoTransIncN             278            276            -0.72%
BenchmarkDgemvSmSmTransInc1               301            301            +0.00%
BenchmarkDgemvSmSmTransIncN               351            356            +1.42%
BenchmarkDgemvMedMedNoTransInc1           15500          15520          +0.13%
BenchmarkDgemvMedMedNoTransIncN           17801          17288          -2.88%
BenchmarkDgemvMedMedTransInc1             19274          19697          +2.19%
BenchmarkDgemvMedMedTransIncN             25618          26515          +3.50%
BenchmarkDgemvLgLgNoTransInc1             1563162        1536796        -1.69%
BenchmarkDgemvLgLgNoTransIncN             1741384        1681823        -3.42%
BenchmarkDgemvLgLgTransInc1               1915664        2053025        +7.17%
BenchmarkDgemvLgLgTransIncN               2645615        2737896        +3.49%
BenchmarkDgemvLgSmNoTransInc1             20699          20642          -0.28%
BenchmarkDgemvLgSmNoTransIncN             24267          25183          +3.77%
BenchmarkDgemvLgSmTransInc1               25352          25561          +0.82%
BenchmarkDgemvLgSmTransIncN               30060          31228          +3.89%
BenchmarkDgemvSmLgNoTransInc1             13945          14376          +3.09%
BenchmarkDgemvSmLgNoTransIncN             15388          15887          +3.24%
BenchmarkDgemvSmLgTransInc1               18686          19441          +4.04%
BenchmarkDgemvSmLgTransIncN               27091          27598          +1.87%
BenchmarkDgerSmSmInc1                     207            212            +2.42%
BenchmarkDgerSmSmIncN                     296            300            +1.35%
BenchmarkDgerMedMedInc1                   15088          15840          +4.98%
BenchmarkDgerMedMedIncN                   21910          23003          +4.99%
BenchmarkDgerLgLgInc1                     1516114        1582292        +4.36%
BenchmarkDgerLgLgIncN                     2249243        2278520        +1.30%
BenchmarkDgerLgSmInc1                     19101          19135          +0.18%
BenchmarkDgerLgSmIncN                     27251          27568          +1.16%
BenchmarkDgerSmLgInc1                     13930          14248          +2.28%
BenchmarkDgerSmLgIncN                     20757          21359          +2.90%
BenchmarkDdotSmallBothUnitary             30.8           21.8           -29.22%
BenchmarkDdotSmallIncUni                  34.5           24.9           -27.83%
BenchmarkDdotSmallUniInc                  34.5           24.6           -28.70%
BenchmarkDdotSmallBothInc                 34.4           24.5           -28.78%
BenchmarkDdotMediumBothUnitary            1411           555            -60.67%
BenchmarkDdotMediumIncUni                 2059           1453           -29.43%
BenchmarkDdotMediumUniInc                 1782           1421           -20.26%
BenchmarkDdotMediumBothInc                2067           1740           -15.82%
BenchmarkDdotLargeBothUnitary             142940         72264          -49.44%
BenchmarkDdotLargeIncUni                  258218         206947         -19.86%
BenchmarkDdotLargeUniInc                  202476         157478         -22.22%
BenchmarkDdotLargeBothInc                 333442         301684         -9.52%
BenchmarkDdotHugeBothUnitary              18907046       14100594       -25.42%
BenchmarkDdotHugeIncUni                   45596376       39428779       -13.53%
BenchmarkDdotHugeUniInc                   32817196       33615833       +2.43%
BenchmarkDdotHugeBothInc                  54101725       54155549       +0.10%
BenchmarkDnrm2SmallUnitaryInc             156            158            +1.28%
BenchmarkDnrm2SmallPosInc                 156            158            +1.28%
BenchmarkDnrm2MediumUnitaryInc            15485          15729          +1.58%
BenchmarkDnrm2MediumPosInc                15417          15665          +1.61%
BenchmarkDnrm2LargeUnitaryInc             1561078        1571014        +0.64%
BenchmarkDnrm2LargePosInc                 1554475        1571741        +1.11%
BenchmarkDnrm2HugeUnitaryInc              155376165      155354841      -0.01%
BenchmarkDnrm2HugePosInc                  160737785      159754393      -0.61%
BenchmarkDasumSmallUnitaryInc             44.3           43.8           -1.13%
BenchmarkDasumSmallPosInc                 49.6           49.3           -0.60%
BenchmarkDasumMediumUnitaryInc            3804           3790           -0.37%
BenchmarkDasumMediumPosInc                4751           4740           -0.23%
BenchmarkDasumLargeUnitaryInc             381907         379806         -0.55%
BenchmarkDasumLargePosInc                 488092         487570         -0.11%
BenchmarkDasumHugeUnitaryInc              39662869       39489189       -0.44%
BenchmarkDasumHugePosInc                  56510911       56533302       +0.04%
BenchmarkIdamaxSmallUnitaryInc            105            86.0           -18.10%
BenchmarkIdamaxSmallPosInc                49.9           50.5           +1.20%
BenchmarkIdamaxMediumUnitaryInc           8791           8003           -8.96%
BenchmarkIdamaxMediumPosInc               5030           4870           -3.18%
BenchmarkIdamaxLargeUnitaryInc            827316         792503         -4.21%
BenchmarkIdamaxLargePosInc                505062         488516         -3.28%
BenchmarkIdamaxHugeUnitaryInc             86080681       82857945       -3.74%
BenchmarkIdamaxHugePosInc                 59109916       64002537       +8.28%
BenchmarkDswapSmallBothUnitary            23.5           22.8           -2.98%
BenchmarkDswapSmallIncUni                 33.4           32.2           -3.59%
BenchmarkDswapSmallUniInc                 33.9           32.6           -3.83%
BenchmarkDswapSmallBothInc                33.8           32.5           -3.85%
BenchmarkDswapMediumBothUnitary           1791           1724           -3.74%
BenchmarkDswapMediumIncUni                2521           2417           -4.13%
BenchmarkDswapMediumUniInc                2508           2413           -3.79%
BenchmarkDswapMediumBothInc               2514           2449           -2.59%
BenchmarkDswapLargeBothUnitary            181532         174850         -3.68%
BenchmarkDswapLargeIncUni                 358768         349946         -2.46%
BenchmarkDswapLargeUniInc                 273151         266191         -2.55%
BenchmarkDswapLargeBothInc                506253         497517         -1.73%
BenchmarkDswapHugeBothUnitary             25468879       24697015       -3.03%
BenchmarkDswapHugeIncUni                  71792741       70348189       -2.01%
BenchmarkDswapHugeUniInc                  53396363       47216399       -11.57%
BenchmarkDswapHugeBothInc                 95437200       91243925       -4.39%
BenchmarkDcopySmallBothUnitary            15.9           15.4           -3.14%
BenchmarkDcopySmallIncUni                 23.0           22.2           -3.48%
BenchmarkDcopySmallUniInc                 22.6           21.9           -3.10%
BenchmarkDcopySmallBothInc                22.3           21.6           -3.14%
BenchmarkDcopyMediumBothUnitary           220            202            -8.18%
BenchmarkDcopyMediumIncUni                1480           1404           -5.14%
BenchmarkDcopyMediumUniInc                1465           1383           -5.60%
BenchmarkDcopyMediumBothInc               1686           1623           -3.74%
BenchmarkDcopyLargeBothUnitary            61981          59578          -3.88%
BenchmarkDcopyLargeIncUni                 230661         221484         -3.98%
BenchmarkDcopyLargeUniInc                 185001         177362         -4.13%
BenchmarkDcopyLargeBothInc                360624         348546         -3.35%
BenchmarkDcopyHugeBothUnitary             13820160       13163016       -4.75%
BenchmarkDcopyHugeIncUni                  55414421       44357175       -19.95%
BenchmarkDcopyHugeUniInc                  41716900       40809841       -2.17%
BenchmarkDcopyHugeBothInc                 83943948       67250947       -19.89%
BenchmarkDaxpySmallBothUnitary            35.5           19.3           -45.63%
BenchmarkDaxpySmallIncUni                 38.6           30.1           -22.02%
BenchmarkDaxpySmallUniInc                 39.0           30.5           -21.79%
BenchmarkDaxpySmallBothInc                38.7           30.1           -22.22%
BenchmarkDaxpyMediumBothUnitary           1801           553            -69.29%
BenchmarkDaxpyMediumIncUni                2504           1724           -31.15%
BenchmarkDaxpyMediumUniInc                2479           1694           -31.67%
BenchmarkDaxpyMediumBothInc               2503           1901           -24.05%
BenchmarkDaxpyLargeBothUnitary            180075         96428          -46.45%
BenchmarkDaxpyLargeIncUni                 303829         278239         -8.42%
BenchmarkDaxpyLargeUniInc                 264730         232079         -12.33%
BenchmarkDaxpyLargeBothInc                412943         417597         +1.13%
BenchmarkDaxpyHugeBothUnitary             23368227       21414429       -8.36%
BenchmarkDaxpyHugeIncUni                  49797079       56107742       +12.67%
BenchmarkDaxpyHugeUniInc                  46231757       42310818       -8.48%
BenchmarkDaxpyHugeBothInc                 76075527       79839799       +4.95%
BenchmarkDrotSmallBothUnitary             40.1           38.9           -2.99%
BenchmarkDrotSmallIncUni                  43.8           42.0           -4.11%
BenchmarkDrotSmallUniInc                  44.5           42.1           -5.39%
BenchmarkDrotSmallBothInc                 43.6           41.4           -5.05%
BenchmarkDrotMediumBothUnitary            3272           3120           -4.65%
BenchmarkDrotMediumIncUni                 3369           3231           -4.10%
BenchmarkDrotMediumUniInc                 3303           3183           -3.63%
BenchmarkDrotMediumBothInc                3438           3282           -4.54%
BenchmarkDrotLargeBothUnitary             339659         315500         -7.11%
BenchmarkDrotLargeIncUni                  449423         418841         -6.80%
BenchmarkDrotLargeUniInc                  352956         349879         -0.87%
BenchmarkDrotLargeBothInc                 538729         543708         +0.92%
BenchmarkDrotHugeBothUnitary              34888482       34604004       -0.82%
BenchmarkDrotHugeIncUni                   71859635       71345995       -0.71%
BenchmarkDrotHugeUniInc                   51488755       50122836       -2.65%
BenchmarkDrotHugeBothInc                  92823747       92653027       -0.18%
BenchmarkDrotmOffDiaSmallBothUnitary      43.0           43.0           +0.00%
BenchmarkDrotmOffDiaSmallIncUni           48.6           48.3           -0.62%
BenchmarkDrotmOffDiaSmallUniInc           48.8           48.8           +0.00%
BenchmarkDrotmOffDiaSmallBothInc          48.0           48.0           +0.00%
BenchmarkDrotmOffDiaMediumBothUnitary     3374           3363           -0.33%
BenchmarkDrotmOffDiaMediumIncUni          3364           3344           -0.59%
BenchmarkDrotmOffDiaMediumUniInc          3251           3256           +0.15%
BenchmarkDrotmOffDiaMediumBothInc         3400           3416           +0.47%
BenchmarkDrotmOffDiaLargeBothUnitary      316008         317192         +0.37%
BenchmarkDrotmOffDiaLargeIncUni           425902         426473         +0.13%
BenchmarkDrotmOffDiaLargeUniInc           354631         355636         +0.28%
BenchmarkDrotmOffDiaLargeBothInc          547825         551504         +0.67%
BenchmarkDrotmOffDiaHugeBothUnitary       34607204       34827649       +0.64%
BenchmarkDrotmOffDiaHugeIncUni            71504149       71902983       +0.56%
BenchmarkDrotmOffDiaHugeUniInc            50324083       50054614       -0.54%
BenchmarkDrotmOffDiaHugeBothInc           92701291       92449074       -0.27%
BenchmarkDrotmDiaSmallBothUnitary         42.9           42.9           +0.00%
BenchmarkDrotmDiaSmallIncUni              48.2           48.3           +0.21%
BenchmarkDrotmDiaSmallUniInc              48.7           48.8           +0.21%
BenchmarkDrotmDiaSmallBothInc             47.8           47.9           +0.21%
BenchmarkDrotmDiaMediumBothUnitary        3362           3390           +0.83%
BenchmarkDrotmDiaMediumIncUni             3345           3346           +0.03%
BenchmarkDrotmDiaMediumUniInc             3252           3251           -0.03%
BenchmarkDrotmDiaMediumBothInc            3398           3419           +0.62%
BenchmarkDrotmDiaLargeBothUnitary         315559         316281         +0.23%
BenchmarkDrotmDiaLargeIncUni              425011         425217         +0.05%
BenchmarkDrotmDiaLargeUniInc              354321         354814         +0.14%
BenchmarkDrotmDiaLargeBothInc             545525         551764         +1.14%
BenchmarkDrotmDiaHugeBothUnitary          34819892       34582109       -0.68%
BenchmarkDrotmDiaHugeIncUni               72499884       71412995       -1.50%
BenchmarkDrotmDiaHugeUniInc               50622898       50313723       -0.61%
BenchmarkDrotmDiaHugeBothInc              101482757      92625131       -8.73%
BenchmarkDrotmRescSmallBothUnitary        45.7           45.5           -0.44%
BenchmarkDrotmRescSmallIncUni             50.0           50.1           +0.20%
BenchmarkDrotmRescSmallUniInc             50.3           50.4           +0.20%
BenchmarkDrotmRescSmallBothInc            49.9           50.0           +0.20%
BenchmarkDrotmRescMediumBothUnitary       3363           3364           +0.03%
BenchmarkDrotmRescMediumIncUni            3324           3343           +0.57%
BenchmarkDrotmRescMediumUniInc            3260           3250           -0.31%
BenchmarkDrotmRescMediumBothInc           3405           3414           +0.26%
BenchmarkDrotmRescLargeBothUnitary        316493         316936         +0.14%
BenchmarkDrotmRescLargeIncUni             425698         426111         +0.10%
BenchmarkDrotmRescLargeUniInc             355927         354807         -0.31%
BenchmarkDrotmRescLargeBothInc            546009         552106         +1.12%
BenchmarkDrotmRescHugeBothUnitary         34554320       34544983       -0.03%
BenchmarkDrotmRescHugeIncUni              72486015       71684374       -1.11%
BenchmarkDrotmRescHugeUniInc              54018499       50279793       -6.92%
BenchmarkDrotmRescHugeBothInc             96959140       92629599       -4.47%
BenchmarkDscalSmallUnitaryInc             17.5           17.4           -0.57%
BenchmarkDscalSmallPosInc                 19.4           19.2           -1.03%
BenchmarkDscalMediumUnitaryInc            1394           1378           -1.15%
BenchmarkDscalMediumPosInc                1468           1491           +1.57%
BenchmarkDscalLargeUnitaryInc             140588         137725         -2.04%
BenchmarkDscalLargePosInc                 276015         267886         -2.95%
BenchmarkDscalHugeUnitaryInc              16266367       15894859       -2.28%
BenchmarkDscalHugePosInc                  63272122       57580284       -9.00%