2014-06-26

Dark Theme for RubyMine and PHPStorm

Today I want to share my theme, that been inspired a lot by Turbo C++ (my first IDE that I used to code when I started studying on Informatics Engineering).

For RubyMine: https://gist.github.com/kokizzu/bb2dfbabd0b649812fe8

For PhpStorm: https://gist.github.com/kokizzu/af51dd79e5140064b03c

2014-06-19

Go 1.2.2 vs 1.3 Benchmark

Golang 1.3 is released, we'll see how much the difference in performance between both of them. Using autobench tool, here's the result on 64-bit Linux, i5-3470 CPU @ 3.20GHz:

# go1
benchmark                          old ns/op      new ns/op      delta
BenchmarkBinaryTree17              4393668071     3439380995     -21.72% 
BenchmarkFannkuch11                2905431683     2571691532     -11.49% 
BenchmarkFmtFprintfEmpty           82.6           67.3           -18.52% 
BenchmarkFmtFprintfString          203            210            +3.45%
BenchmarkFmtFprintfInt             171            158            -7.60%
BenchmarkFmtFprintfIntInt          272            256            -5.88%
BenchmarkFmtFprintfPrefixedInt     250            238            -4.80%
BenchmarkFmtFprintfFloat           365            347            -4.93%
BenchmarkFmtManyArgs               1024           1100           +7.42%
BenchmarkGobDecode                 7575925        7713419        +1.81%
BenchmarkGobEncode                 4223057        4591922        +8.73%
BenchmarkGzip                      381224443      373719944      -1.97%
BenchmarkGunzip                    1342948555     93186405       -93.06% 
BenchmarkHTTPClientServer          45743          44988          -1.65%
BenchmarkJSONEncode                20200172       19540321       -3.27%
BenchmarkJSONDecode                77714796       69865804       -10.10% 
BenchmarkMandelbrot200             4036132        4021347        -0.37%
BenchmarkGoParse                   4277297        4028435        -5.82%
BenchmarkRegexpMatchEasy0_32       112            114            +1.79%
BenchmarkRegexpMatchEasy0_1K       300            298            -0.67%
BenchmarkRegexpMatchEasy1_32       92.9           97.6           +5.06%
BenchmarkRegexpMatchEasy1_1K       783            766            -2.17%
BenchmarkRegexpMatchMedium_32      169            181            +7.10%
BenchmarkRegexpMatchMedium_1K      57654          63410          +9.98%
BenchmarkRegexpMatchHard_32        2841           2915           +2.60%
BenchmarkRegexpMatchHard_1K        92579          95782          +3.46%
BenchmarkRevcomp                   641546393      608532901      -5.15%
BenchmarkTemplate                  93262429       97820865       +4.89%
BenchmarkTimeParse                 388            391            +0.77%
BenchmarkTimeFormat                349            342            -2.01%

benchmark                         old MB/s     new MB/s     speedup     
BenchmarkGobDecode                101.31       99.51        0.98x 
BenchmarkGobEncode                181.75       167.15       0.92x 
BenchmarkGzip                     50.90        51.92        1.02x 
BenchmarkGunzip                   14.45        208.24       14.41x
BenchmarkJSONEncode               96.06        99.31        1.03x 
BenchmarkJSONDecode               24.97        27.77        1.11x 
BenchmarkGoParse                  13.54        14.38        1.06x 
BenchmarkRegexpMatchEasy0_32      285.59       279.63       0.98x 
BenchmarkRegexpMatchEasy0_1K      3405.77      3428.58      1.01x 
BenchmarkRegexpMatchEasy1_32      344.29       328.03       0.95x 
BenchmarkRegexpMatchEasy1_1K      1307.08      1335.30      1.02x 
BenchmarkRegexpMatchMedium_32     5.90         5.52         0.94x 
BenchmarkRegexpMatchMedium_1K     17.76        16.15        0.91x 
BenchmarkRegexpMatchHard_32       11.26        10.98        0.98x 
BenchmarkRegexpMatchHard_1K       11.06        10.69        0.97x 
BenchmarkRevcomp                  396.18       417.67       1.05x 
BenchmarkTemplate                 20.81        19.84        0.95x 

# runtime
benchmark                                 old ns/op     new ns/op     delta
BenchmarkAppend                           87.1          42.2          -51.55% 
BenchmarkAppend1Byte                      115           102           -11.30% 
BenchmarkAppend4Bytes                     107           98.4          -8.04%
BenchmarkAppend8Bytes                     105           103           -1.90%
BenchmarkAppend16Bytes                    109           102           -6.42%
BenchmarkAppend32Bytes                    110           110           +0.00%
BenchmarkAppendSpecialCase                31.5          24.5          -22.22% 
BenchmarkSelectUncontended                228           189           -17.11% 
BenchmarkSelectContended                  224           189           -15.62% 
BenchmarkSelectNonblock                   93.1          91.1          -2.15%
BenchmarkChanUncontended                  54.5          52.8          -3.12%
BenchmarkChanContended                    54.7          52.8          -3.47%
BenchmarkChanSync                         131           123           -6.11%
BenchmarkChanProdCons0                    133           125           -6.02%
BenchmarkChanProdCons10                   79.1          76.4          -3.41%
BenchmarkChanProdCons100                  58.4          58.8          +0.68%
BenchmarkChanProdConsWork0                589           478           -18.85% 
BenchmarkChanProdConsWork10               530           425           -19.81% 
BenchmarkChanProdConsWork100              510           406           -20.39% 
BenchmarkChanCreation                     147           146           -0.68%
BenchmarkChanSem                          53.2          51.9          -2.44%
BenchmarkCallClosure                      2.23          3.44          +54.26% 
BenchmarkCallClosure1                     3.11          3.72          +19.61% 
BenchmarkCallClosure2                     33.6          23.9          -28.87% 
BenchmarkCallClosure3                     34.6          25.8          -25.43% 
BenchmarkCallClosure4                     35.9          26.5          -26.18% 
BenchmarkComplex128DivNormal              17.3          17.6          +1.73%
BenchmarkComplex128DivNisNaN              13.1          13.4          +2.29%
BenchmarkComplex128DivDisNaN              12.5          12.8          +2.40%
BenchmarkComplex128DivNisInf              9.48          9.76          +2.95%
BenchmarkComplex128DivDisInf              9.75          9.49          -2.67%
BenchmarkConvT2ESmall                     8.92          9.47          +6.17%
BenchmarkConvT2EUintptr                   0.56          0.56          +0.00%
BenchmarkConvT2ELarge                     44.6          51.7          +15.92% 
BenchmarkConvT2ISmall                     10.3          10.6          +2.91%
BenchmarkConvT2IUintptr                   0.98          0.98          +0.00%
BenchmarkConvT2ILarge                     46.8          53.8          +14.96% 
BenchmarkConvI2E                          3.90          3.90          +0.00%
BenchmarkConvI2I                          14.5          15.1          +4.14%
BenchmarkAssertE2T                        10.3          10.6          +2.91%
BenchmarkAssertE2TLarge                   11.1          11.7          +5.41%
BenchmarkAssertE2I                        15.6          15.9          +1.92%
BenchmarkAssertI2T                        10.3          11.1          +7.77%
BenchmarkAssertI2I                        15.6          15.9          +1.92%
BenchmarkAssertI2E                        3.90          4.18          +7.18%
BenchmarkAssertE2E                        0.56          0.70          +25.00% 
BenchmarkMalloc8                          31.5          21.9          -30.48% 
BenchmarkMalloc16                         36.2          33.3          -8.01%
BenchmarkMallocTypeInfo8                  47.5          45.6          -4.00%
BenchmarkMallocTypeInfo16                 51.1          49.6          -2.94%
BenchmarkHashStringSpeed                  23.4          22.9          -2.14%
BenchmarkHashInt32Speed                   14.4          14.7          +2.08%
BenchmarkHashInt64Speed                   14.5          15.0          +3.45%
BenchmarkHashStringArraySpeed             73.3          62.3          -15.01% 
BenchmarkMegMap                           20.3          21.2          +4.43%
BenchmarkMegOneMap                        12.8          13.4          +4.69%
BenchmarkMegEqMap                         60138         61645         +2.51%
BenchmarkMegEmptyMap                      3.35          3.71          +10.75% 
BenchmarkSmallStrMap                      19.2          19.8          +3.12%
BenchmarkMapStringKeysEight_16            22.9          20.9          -8.73%
BenchmarkMapStringKeysEight_32            19.5          19.8          +1.54%
BenchmarkMapStringKeysEight_64            19.5          19.8          +1.54%
BenchmarkMapStringKeysEight_1M            19.5          19.8          +1.54%
BenchmarkIntMap                           17.3          19.8          +14.45% 
BenchmarkRepeatedLookupStrMapKey32        34.5          35.8          +3.77%
BenchmarkRepeatedLookupStrMapKey1M        292271        292336        +0.02%
BenchmarkNewEmptyMap                      107           113           +5.61%
BenchmarkMemmove32                        4.74          4.74          +0.00%
BenchmarkMemmove4K                        94.9          96.6          +1.79%
BenchmarkMemmove64K                       2305          2334          +1.26%
BenchmarkMemmove4M                        384353        398570        +3.70%
BenchmarkMemmove64M                       14539833      14359420      -1.24%
BenchmarkFinalizer                        140           1101          +686.43%
BenchmarkFinalizerRun                     550           1721          +212.91%
BenchmarkStackGrowth                      520           421           -19.04% 
BenchmarkStackGrowthDeep                  72650         57003         -21.54% 
BenchmarkCreateGoroutines                 107           80.5          -24.77% 
BenchmarkCreateGoroutinesParallel         107           80.8          -24.49% 
BenchmarkMatmult                          7.02          5.12          -27.07% 
BenchmarkIfaceCmp100                      194           104           -46.39% 
BenchmarkIfaceCmpNil100                   147           147           +0.00%
BenchmarkDefer                            71.0          43.9          -38.17% 
BenchmarkDefer10                          63.4          39.8          -37.22% 
BenchmarkDeferMany                        95.6          1928          +1916.74% 
BenchmarkCompareStringEqual               8.36          6.69          -19.98% 
BenchmarkCompareStringIdentical           3.90          3.34          -14.36% 
BenchmarkCompareStringSameLength          7.53          5.57          -26.03% 
BenchmarkCompareStringDifferentLength     1.67          0.84          -49.70% 
BenchmarkCompareStringBigUnaligned        62710         62551         -0.25%
BenchmarkCompareStringBig                 60338         61690         +2.24%

benchmark                              old MB/s     new MB/s     speedup     
BenchmarkMemmove32                     6752.83      6746.83      1.00x 
BenchmarkMemmove4K                     43174.80     42409.11     0.98x 
BenchmarkMemmove64K                    28422.35     28074.73     0.99x 
BenchmarkMemmove4M                     10912.61     10523.37     0.96x 
BenchmarkMemmove64M                    4615.52      4673.51      1.01x 
BenchmarkCompareStringBigUnaligned     16721.08     16763.66     1.00x 
BenchmarkCompareStringBig              17378.34     16997.66     0.98x

# http
benchmark                                    old ns/op     new ns/op     delta
BenchmarkHeaderWriteSubset                   856           796           -7.01% 
BenchmarkReadRequestChrome                   4952          4626          -6.58% 
BenchmarkReadRequestCurl                     2724          2704          -0.73% 
BenchmarkReadRequestApachebench              2755          2683          -2.61% 
BenchmarkReadRequestSiege                    3557          3455          -2.87% 
BenchmarkReadRequestWrk                      1975          2042          +3.39% 
BenchmarkClientServer                        45364         45086         -0.61% 
BenchmarkClientServerParallel4               40594         40459         -0.33% 
BenchmarkClientServerParallel64              38802         37238         -4.03% 
BenchmarkServer                              112993        109860        -2.77% 
BenchmarkServerFakeConnNoKeepAlive           9968          9586          -3.83% 
BenchmarkServerFakeConnWithKeepAlive         8078          7392          -8.49% 
BenchmarkServerFakeConnWithKeepAliveLite     5058          5178          +2.37% 
BenchmarkServerHandlerTypeLen                6668          6471          -2.95% 
BenchmarkServerHandlerNoLen                  6098          5858          -3.94% 
BenchmarkServerHandlerNoType                 6400          6312          -1.38% 
BenchmarkServerHandlerNoHeader               4699          4643          -1.19% 

benchmark                           old MB/s     new MB/s     speedup     
BenchmarkReadRequestChrome          123.38       132.06       1.07x 
BenchmarkReadRequestCurl            28.63        28.84        1.01x 
BenchmarkReadRequestApachebench     29.76        30.56        1.03x 
BenchmarkReadRequestSiege           42.45        43.70        1.03x 
BenchmarkReadRequestWrk             20.25        19.58        0.97x 

# floats
benchmark                   old ns/op     new ns/op     delta
BenchmarkMinSmall           11.4          11.6          +1.75%
BenchmarkMinMed             606           618           +1.98%
BenchmarkMinLarge           56508         59211         +4.78%
BenchmarkMinHuge            7129637       7118827       -0.15%
BenchmarkAddTwoSmall        19.7          19.5          -1.02%
BenchmarkAddFourSmall       42.6          38.5          -9.62%
BenchmarkAddTwoMed          858           855           -0.35%
BenchmarkAddFourMed         2558          2544          -0.55%
BenchmarkAddTwoLarge        85419         87294         +2.20%
BenchmarkAddFourLarge       256032        261904        +2.29%
BenchmarkAddTwoHuge         22318732      22296116      -0.10%
BenchmarkAddFourHuge        68351963      68398657      +0.07%
BenchmarkLogSumExpSmall     222           223           +0.45%
BenchmarkLogSumExpMed       16617         16940         +1.94%
BenchmarkLogSumExpLarge     1660844       1684650       +1.43%
BenchmarkLogSumExpHuge      167184482     169930103     +1.64%
BenchmarkDotSmall           15.2          12.1          -20.39% 
BenchmarkDotMed             854           845           -1.05%
BenchmarkDotLarge           83652         83666         +0.02%
BenchmarkDotHuge            14198837      14076741      -0.86% 

# cipher
benchmark                  old ns/op     new ns/op     delta
BenchmarkAESCFBEncrypt     6283          3366          -46.43% 
BenchmarkAESCFBDecrypt     6225          3560          -42.81% 
BenchmarkAESOFB            4915          2346          -52.27% 
BenchmarkAESCTR            5303          2101          -60.38% 
BenchmarkAESCBCEncrypt     4967          2723          -45.18% 
BenchmarkAESCBCDecrypt     6934          2618          -62.24% 

benchmark                  old MB/s     new MB/s     speedup     
BenchmarkAESCFBEncrypt     162.82       303.85       1.87x 
BenchmarkAESCFBDecrypt     164.31       287.33       1.75x 
BenchmarkAESOFB            208.10       436.06       2.10x 
BenchmarkAESCTR            192.87       486.76       2.52x 
BenchmarkAESCBCEncrypt     206.12       376.01       1.82x 
BenchmarkAESCBCDecrypt     147.68       391.11       2.65x 

# megajson
benchmark                old ns/op     new ns/op     delta
BenchmarkCodeEncoder     11781406      11780666      -0.01% 
BenchmarkCodeDecoder     46571748      46638330      +0.14% 

benchmark                old MB/s     new MB/s     speedup     
BenchmarkCodeEncoder     164.71       164.72       1.00x 
BenchmarkCodeDecoder     41.67        41.61        1.00x

# snappy
Makefile:64: recipe for target 'snappy' failed

retry~

# go1
benchmark                          old ns/op      new ns/op      delta
BenchmarkBinaryTree17              3654353852     3434368270     -6.02% 
BenchmarkFannkuch11                2854598755     2552370388     -10.59% 
BenchmarkFmtFprintfEmpty           82.4           67.2           -18.45% 
BenchmarkFmtFprintfString          199            210            +5.53% 
BenchmarkFmtFprintfInt             170            157            -7.65% 
BenchmarkFmtFprintfIntInt          272            251            -7.72% 
BenchmarkFmtFprintfPrefixedInt     247            235            -4.86% 
BenchmarkFmtFprintfFloat           358            362            +1.12% 
BenchmarkFmtManyArgs               1004           1078           +7.37% 
BenchmarkGobDecode                 7546739        7677827        +1.74% 
BenchmarkGobEncode                 4231271        4878852        +15.30% 
BenchmarkGzip                      374066721      372888806      -0.31% 
BenchmarkGunzip                    92557469       93076166       +0.56% 
BenchmarkHTTPClientServer          45742          45069          -1.47% 
BenchmarkJSONEncode                19902803       19574255       -1.65% 
BenchmarkJSONDecode                77741697       72790242       -6.37% 
BenchmarkMandelbrot200             4011793        4016369        +0.11% 
BenchmarkGoParse                   4269777        4062284        -4.86% 
BenchmarkRegexpMatchEasy0_32       111            115            +3.60% 
BenchmarkRegexpMatchEasy0_1K       299            297            -0.67% 
BenchmarkRegexpMatchEasy1_32       92.9           97.2           +4.63% 
BenchmarkRegexpMatchEasy1_1K       786            766            -2.54% 
BenchmarkRegexpMatchMedium_32      169            177            +4.73% 
BenchmarkRegexpMatchMedium_1K      58737          64574          +9.94% 
BenchmarkRegexpMatchHard_32        2845           2923           +2.74% 
BenchmarkRegexpMatchHard_1K        92750          96424          +3.96% 
BenchmarkRevcomp                   641986169      598134442      -6.83% 
BenchmarkTemplate                  93200532       96877619       +3.95% 
BenchmarkTimeParse                 388            400            +3.09% 
BenchmarkTimeFormat                346            343            -0.87% 

benchmark                         old MB/s     new MB/s     speedup     
BenchmarkGobDecode                101.70       99.97        0.98x 
BenchmarkGobEncode                181.40       157.32       0.87x 
BenchmarkGzip                     51.88        52.04        1.00x 
BenchmarkGunzip                   209.65       208.48       0.99x 
BenchmarkJSONEncode               97.50        99.13        1.02x 
BenchmarkJSONDecode               24.96        26.66        1.07x 
BenchmarkGoParse                  13.57        14.26        1.05x 
BenchmarkRegexpMatchEasy0_32      287.60       276.88       0.96x 
BenchmarkRegexpMatchEasy0_1K      3414.12      3439.59      1.01x 
BenchmarkRegexpMatchEasy1_32      344.32       329.32       0.96x 
BenchmarkRegexpMatchEasy1_1K      1302.57      1336.36      1.03x 
BenchmarkRegexpMatchMedium_32     5.89         5.65         0.96x 
BenchmarkRegexpMatchMedium_1K     17.43        15.86        0.91x 
BenchmarkRegexpMatchHard_32       11.24        10.94        0.97x 
BenchmarkRegexpMatchHard_1K       11.04        10.62        0.96x 
BenchmarkRevcomp                  395.91       424.93       1.07x 
BenchmarkTemplate                 20.82        20.03        0.96x 

# runtime
benchmark                                 old ns/op     new ns/op     delta
BenchmarkAppend                           87.2          41.8          -52.06% 
BenchmarkAppend1Byte                      115           102           -11.30% 
BenchmarkAppend4Bytes                     107           98.7          -7.76% 
BenchmarkAppend8Bytes                     105           105           +0.00% 
BenchmarkAppend16Bytes                    109           99.9          -8.35% 
BenchmarkAppend32Bytes                    110           110           +0.00% 
BenchmarkAppendSpecialCase                31.2          24.6          -21.15% 
BenchmarkSelectUncontended                228           188           -17.54% 
BenchmarkSelectContended                  224           191           -14.73% 
BenchmarkSelectNonblock                   93.4          91.2          -2.36% 
BenchmarkChanUncontended                  54.6          52.8          -3.30% 
BenchmarkChanContended                    54.9          52.7          -4.01% 
BenchmarkChanSync                         131           124           -5.34% 
BenchmarkChanProdCons0                    133           126           -5.26% 
BenchmarkChanProdCons10                   78.4          76.9          -1.91% 
BenchmarkChanProdCons100                  58.3          59.0          +1.20% 
BenchmarkChanProdConsWork0                589           480           -18.51% 
BenchmarkChanProdConsWork10               531           427           -19.59% 
BenchmarkChanProdConsWork100              511           407           -20.35% 
BenchmarkChanCreation                     148           145           -2.03% 
BenchmarkChanSem                          53.3          51.9          -2.63% 
BenchmarkCallClosure                      2.23          3.44          +54.26% 
BenchmarkCallClosure1                     3.12          3.73          +19.55% 
BenchmarkCallClosure2                     33.6          24.0          -28.57% 
BenchmarkCallClosure3                     34.1          26.5          -22.29% 
BenchmarkCallClosure4                     36.0          25.7          -28.61% 
BenchmarkComplex128DivNormal              17.3          17.6          +1.73% 
BenchmarkComplex128DivNisNaN              13.1          13.4          +2.29% 
BenchmarkComplex128DivDisNaN              12.5          12.8          +2.40% 
BenchmarkComplex128DivNisInf              9.48          9.78          +3.16% 
BenchmarkComplex128DivDisInf              9.78          9.49          -2.97% 
BenchmarkConvT2ESmall                     8.92          9.50          +6.50% 
BenchmarkConvT2EUintptr                   0.56          0.56          +0.00% 
BenchmarkConvT2ELarge                     44.7          51.5          +15.21% 
BenchmarkConvT2ISmall                     10.3          10.6          +2.91% 
BenchmarkConvT2IUintptr                   0.98          0.98          +0.00% 
BenchmarkConvT2ILarge                     47.0          53.8          +14.47% 
BenchmarkConvI2E                          3.90          3.90          +0.00% 
BenchmarkConvI2I                          14.5          14.8          +2.07% 
BenchmarkAssertE2T                        10.3          10.6          +2.91% 
BenchmarkAssertE2TLarge                   11.2          11.8          +5.36% 
BenchmarkAssertE2I                        15.7          15.9          +1.27% 
BenchmarkAssertI2T                        10.3          11.1          +7.77% 
BenchmarkAssertI2I                        15.7          15.9          +1.27% 
BenchmarkAssertI2E                        3.90          4.18          +7.18% 
BenchmarkAssertE2E                        0.56          0.70          +25.00% 
BenchmarkMalloc8                          31.8          22.0          -30.82% 
BenchmarkMalloc16                         35.8          33.1          -7.54% 
BenchmarkMallocTypeInfo8                  47.4          45.5          -4.01% 
BenchmarkMallocTypeInfo16                 51.0          49.7          -2.55% 
BenchmarkHashStringSpeed                  22.8          23.0          +0.88% 
BenchmarkHashInt32Speed                   14.4          14.6          +1.39% 
BenchmarkHashInt64Speed                   14.9          14.6          -2.01% 
BenchmarkHashStringArraySpeed             73.5          65.2          -11.29% 
BenchmarkMegMap                           20.3          21.2          +4.43% 
BenchmarkMegOneMap                        12.9          13.8          +6.98% 
BenchmarkMegEqMap                         60513         60180         -0.55% 
BenchmarkMegEmptyMap                      3.36          3.72          +10.71% 
BenchmarkSmallStrMap                      19.2          19.8          +3.12% 
BenchmarkMapStringKeysEight_16            22.9          20.9          -8.73% 
BenchmarkMapStringKeysEight_32            19.5          19.8          +1.54% 
BenchmarkMapStringKeysEight_64            19.5          19.8          +1.54% 
BenchmarkMapStringKeysEight_1M            19.6          19.8          +1.02% 
BenchmarkIntMap                           17.3          19.8          +14.45% 
BenchmarkRepeatedLookupStrMapKey32        34.8          35.8          +2.87% 
BenchmarkRepeatedLookupStrMapKey1M        292872        292774        -0.03% 
BenchmarkNewEmptyMap                      108           114           +5.56% 
BenchmarkMemmove32                        4.75          4.75          +0.00% 
BenchmarkMemmove4K                        94.0          96.6          +2.77% 
BenchmarkMemmove64K                       2292          2326          +1.48% 
BenchmarkMemmove4M                        364318        382791        +5.07% 
BenchmarkMemmove64M                       14604954      14430825      -1.19% 
BenchmarkFinalizer                        140           1107          +690.71% 
BenchmarkFinalizerRun                     547           1810          +230.90% 
BenchmarkStackGrowth                      520           421           -19.04% 
BenchmarkStackGrowthDeep                  72767         57273         -21.29% 
BenchmarkCreateGoroutines                 108           80.9          -25.09% 
BenchmarkCreateGoroutinesParallel         107           81.3          -24.02% 
BenchmarkMatmult                          7.06          5.08          -28.05% 
BenchmarkIfaceCmp100                      194           104           -46.39% 
BenchmarkIfaceCmpNil100                   147           147           +0.00% 
BenchmarkDefer                            71.3          45.3          -36.47% 
BenchmarkDefer10                          63.4          38.5          -39.27% 
BenchmarkDeferMany                        96.1          1952          +1931.22% 
BenchmarkCompareStringEqual               8.36          6.70          -19.86% 
BenchmarkCompareStringIdentical           3.91          3.34          -14.58% 
BenchmarkCompareStringSameLength          7.53          5.58          -25.90% 
BenchmarkCompareStringDifferentLength     1.67          0.84          -49.70% 
BenchmarkCompareStringBigUnaligned        62086         62540         +0.73% 
BenchmarkCompareStringBig                 60163         60314         +0.25% 

benchmark                              old MB/s     new MB/s     speedup     
BenchmarkMemmove32                     6734.08      6740.08      1.00x 
BenchmarkMemmove4K                     43570.28     42403.47     0.97x 
BenchmarkMemmove64K                    28585.59     28168.56     0.99x 
BenchmarkMemmove4M                     11512.74     10957.14     0.95x 
BenchmarkMemmove64M                    4594.94      4650.38      1.01x 
BenchmarkCompareStringBigUnaligned     16889.04     16766.54     0.99x 
BenchmarkCompareStringBig              17428.81     17385.17     1.00x 

# http
benchmark                                    old ns/op     new ns/op     delta
BenchmarkHeaderWriteSubset                   860           814           -5.35% 
BenchmarkReadRequestChrome                   5013          4657          -7.10% 
BenchmarkReadRequestCurl                     2760          2674          -3.12% 
BenchmarkReadRequestApachebench              2745          2696          -1.79% 
BenchmarkReadRequestSiege                    3549          3386          -4.59% 
BenchmarkReadRequestWrk                      1976          2028          +2.63% 
BenchmarkClientServer                        45085         46721         +3.63% 
BenchmarkClientServerParallel4               40607         39882         -1.79% 
BenchmarkClientServerParallel64              37787         37199         -1.56% 
BenchmarkServer                              106776        108775        +1.87% 
BenchmarkServerFakeConnNoKeepAlive           9923          9572          -3.54% 
BenchmarkServerFakeConnWithKeepAlive         7972          7485          -6.11% 
BenchmarkServerFakeConnWithKeepAliveLite     5033          5082          +0.97% 
BenchmarkServerHandlerTypeLen                6538          6476          -0.95% 
BenchmarkServerHandlerNoLen                  5976          5859          -1.96% 
BenchmarkServerHandlerNoType                 6202          6282          +1.29% 
BenchmarkServerHandlerNoHeader               4584          4656          +1.57% 

benchmark                           old MB/s     new MB/s     speedup     
BenchmarkReadRequestChrome          121.87       131.18       1.08x 
BenchmarkReadRequestCurl            28.25        29.17        1.03x 
BenchmarkReadRequestApachebench     29.87        30.41        1.02x 
BenchmarkReadRequestSiege           42.54        44.59        1.05x 
BenchmarkReadRequestWrk             20.24        19.72        0.97x

# floats
benchmark                   old ns/op     new ns/op     delta
BenchmarkMinSmall           11.4          11.5          +0.88% 
BenchmarkMinMed             605           619           +2.31% 
BenchmarkMinLarge           56596         59358         +4.88% 
BenchmarkMinHuge            7141490       7148974       +0.10% 
BenchmarkAddTwoSmall        19.8          19.5          -1.52% 
BenchmarkAddFourSmall       43.0          38.5          -10.47% 
BenchmarkAddTwoMed          860           855           -0.58% 
BenchmarkAddFourMed         2565          2543          -0.86% 
BenchmarkAddTwoLarge        85567         87913         +2.74% 
BenchmarkAddFourLarge       256388        263466        +2.76% 
BenchmarkAddTwoHuge         22670204      22297992      -1.64% 
BenchmarkAddFourHuge        69202089      68393846      -1.17% 
BenchmarkLogSumExpSmall     223           223           +0.00% 
BenchmarkLogSumExpMed       16614         16953         +2.04% 
BenchmarkLogSumExpLarge     1659305       1690761       +1.90% 
BenchmarkLogSumExpHuge      167223818     169963080     +1.64% 
BenchmarkDotSmall           15.1          12.3          -18.54% 
BenchmarkDotMed             856           848           -0.93% 
BenchmarkDotLarge           83808         83722         -0.10% 
BenchmarkDotHuge            14141122      14071509      -0.49%

# cipher
benchmark                  old ns/op     new ns/op     delta
BenchmarkAESCFBEncrypt     6259          3366          -46.22% 
BenchmarkAESCFBDecrypt     6221          3570          -42.61% 
BenchmarkAESOFB            5632          2351          -58.26% 
BenchmarkAESCTR            5304          2100          -60.41% 
BenchmarkAESCBCEncrypt     4979          2728          -45.21% 
BenchmarkAESCBCDecrypt     6933          2617          -62.25% 

benchmark                  old MB/s     new MB/s     speedup     
BenchmarkAESCFBEncrypt     163.42       303.90       1.86x 
BenchmarkAESCFBDecrypt     164.43       286.52       1.74x 
BenchmarkAESOFB            181.63       435.00       2.39x 
BenchmarkAESCTR            192.84       486.98       2.53x 
BenchmarkAESCBCEncrypt     205.64       375.33       1.83x 
BenchmarkAESCBCDecrypt     147.70       391.16       2.65x

# megajson
benchmark                old ns/op     new ns/op     delta
BenchmarkCodeEncoder     11849738      11814373      -0.30% 
BenchmarkCodeDecoder     46539678      46528214      -0.02% 

benchmark                old MB/s     new MB/s     speedup     
BenchmarkCodeEncoder     163.76       164.25       1.00x 
BenchmarkCodeDecoder     41.70        41.71        1.00x

# snappy
Makefile:64: recipe for target 'snappy' failed

2014-06-13

Web Framework for Go

Let's try to use some server side web framework, I found two that support hot-compile/reload, that is Revel and Beego. Revel does not include any ORM by default, but it has example that uses GORP. Beego have its built-in ORM, even although I think I will like GORM better since it's similar to Ruby's DataMapper. There are no example that show combination of Beego+GORM or Revel+GORM. One more difference I found between Beego and Revel, Beego always immediately recompile when any file changed, Revel doesn't, Revel wait until there are request before recompiling, I guess on this part, Rever more likely to use fewer resource. Revel take about 15 seconds to recompile in my AMD C-60 netbook processor, Beego take about 12 seconds. Both framework uses Go's template engine (which I don't like >w<). For development, Revel gives better flow just edit and refresh the site, even when there's an error, the error shows up on the browser, not on the console. Beego shows the error on the console (just like Sinatra), not on the browser. Some other web framework I found is Martini, this one looks like just a plain NodeJS. This one doesn't support hot-compile/reload, but you could use gin or fresh (just like rerun on Ruby, or supervisor/nodemon for NodeJS) as stated on it's documentation.

I guess I will try to use Revel+GORM, wish me luck~

2014-06-08

IDEs for Go

As programmer, we need good IDE (or just editor if you have good memory of the APIs), well.. In C/C++ we have QtCreator and Visual Studio, in Object-Pascal we Have Embarcadero Delphi, in Javascript we have Brackets.io or Webstorm, in Ruby we have RubyMine, in PHP we have PHPStorm, in Java-based languages (Scala, Clojure, Groovy) we have Eclipse, Netbeans and IntelliJ IDEA. What's for Golang?

First of all don't forget to set GOROOT (/usr/lib/go on ArchLinux) and GOPATH.

1. Vim + Vim-Go
Actually I've used vim for so long to edit a single source file, but not for IDE with many files, I've tried nedtree and many vim plugins but nothing capture my heart, except for the color scheme. Anyway you need Pathogen to install it easily, also YCM and the autocomplete works well (autocomplete: Ctrl+X + Ctrl+O). Sometimes when exiting vim it shows some error.

2. Goclipse
Just install eclipse pacman -S eclipse, add http://releases.goclipse.googlecode.com/git/ to the update site and install Goclipse. Set all the Go path configuration on the Preferences, kill gocode and start manually if necessary.
The autocomplete works fine. But the eclipse color configuration is quite annoying for dark theme desktop.

3. GolangIDE
Seems good, latest version was LiteIDE X22, cross-platform, available on ArchLinux via pacman -S liteide
set the correct GOROOT on your /usr/share/liteide/liteenv/linux64.env file (for 64-bit), and the autocomplete works fine!

4. IntelliJ IDEA CE + Golang Plugin
Just install IntelliJ IDEA Community Edition pacman -S intellij-idea-community-edition, go to plugins, browse, install Golang.
The autocomplete doesn't work well at all, it only shows sout, souf, soutm, soutp.

Which one better?
I guess I'll go with GolangIDE and Vim :3

2014-06-03

Go's Scanln (GoLang)

So.. Today I tried to study about Go, programming language by Google, that i expect would be good replacement for C/C++/Java..

Instalation? easy~
sudo pacman -S go # ArchLinux
go version # go version go1.2.2 linux/amd64
running? easy~
go build try1.go && ./try1 # or
go run try1.go
input and output? easy~ ^^)b
package main
import (
 "bufio"
 "fmt"
 "os"
)
func main(){
  var i int
  var f float64
  var s string
  r := bufio.NewReader(os.Stdin)
  _, err := fmt.Scan(&i,&f,&s)
  if err == nil {
   fmt.Println("read int, float and string:",i,f,s)
  } else {
   fmt.Println("Error:",err)
  }
  s, err = r.ReadString('\n')
  if err == nil {
   fmt.Println("read line:",s)
  } else {
   fmt.Println("Error:",err)
  }
}

 Just some tricy part, I expect that fmt.Scanln would behave like C++'s getline(cin,str) or Java's Scanner scan.nextLine(), but it doesn't.. oh well..