1. 28 Apr, 2016 20 commits
    • Matthew Dempsky's avatar
      net: remove unneeded tags from dnsRR structs · bec0863b
      Matthew Dempsky authored
      DNS packing and unpacking uses hand-coded struct walking functions
      rather than reflection, so these tags are unneeded and just contribute
      to their runtime reflect metadata size.
      
      Change-Id: I2db09d5159912bcbc3b482cbf23a50fa8fa807fa
      Reviewed-on: https://go-review.googlesource.com/22594
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      bec0863b
    • Matthew Dempsky's avatar
      net: remove internal support for obsolete DNS record types · c231dd21
      Matthew Dempsky authored
      There are no real world use cases for HINFO, MINFO, MB, MG, or MR
      records, and package net's exposed APIs don't provide any way to
      access them even if there were. If a use ever does show up, we can
      revive them. In the mean time, this is just effectively-dead code that
      sticks around because of rr_mk.
      
      Change-Id: I6c188b5ee32f3b3a04588b79a0ee9c2e3e725ccc
      Reviewed-on: https://go-review.googlesource.com/22593
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c231dd21
    • Brad Fitzpatrick's avatar
      net/http, net/http/httptrace: new package for tracing HTTP client requests · 1518d431
      Brad Fitzpatrick authored
      Updates #12580
      
      Change-Id: I9f9578148ef2b48dffede1007317032d39f6af55
      Reviewed-on: https://go-review.googlesource.com/22191Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1518d431
    • Brad Fitzpatrick's avatar
      os/exec: fix variable shadow, don't leak goroutine · 1b591dfb
      Brad Fitzpatrick authored
      Goroutine leak checking is still too tedious, so untested.
      
      See #6705 which is my fault for forgetting to mail out.
      
      Change-Id: I899fb311c9d4229ff1dbd3f54fe307805e17efee
      Reviewed-on: https://go-review.googlesource.com/22581Reviewed-by: 's avatarAhmed W. <oneofone@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1b591dfb
    • Robert Griesemer's avatar
      cmd/compile: use delta encoding for filenames in export data position info · 6c11e271
      Robert Griesemer authored
      This reduces the export data size significantly (15%-25%) for some packages,
      especially where the paths are very long or if there are many files involved.
      Slight (2%) reduction on average, with virtually no increases in export data
      size.
      
      Selected export data sizes for packages with |delta %| > 3%:
      
                           package   before    after   delta     %
      
              cmd/asm/internal/arch   11647    11088    -559   -4%
         cmd/compile/internal/amd64     838      600    -238  -27%
           cmd/compile/internal/arm    7323     6793    -530   -6%
         cmd/compile/internal/arm64   19948    18971    -977   -4%
           cmd/compile/internal/big    9043     8548    -495   -4%
        cmd/compile/internal/mips64     645      482    -163  -24%
         cmd/compile/internal/ppc64     695      497    -198  -27%
         cmd/compile/internal/s390x     553      433    -120  -21%
           cmd/compile/internal/x86     744      555    -189  -24%
                           cmd/dist     145      121     -24  -16%
               cmd/internal/objfile   17359    16474    -885   -4%
         cmd/internal/pprof/symbolz    8346     7941    -405   -4%
            cmd/link/internal/amd64   11178    10604    -574   -4%
              cmd/link/internal/arm     204      171     -33  -15%
            cmd/link/internal/arm64     210      175     -35  -16%
           cmd/link/internal/mips64     213      177     -36  -16%
            cmd/link/internal/ppc64     211      176     -35  -16%
            cmd/link/internal/s390x     210      175     -35  -16%
              cmd/link/internal/x86     203      170     -33  -15%
                          cmd/trace     782      744     -38   -4%
                       compress/lzw     402      383     -19   -4%
                         crypto/aes     311      262     -49  -15%
                      crypto/cipher    1138      959    -179  -15%
                         crypto/des     315      288     -27   -8%
                    crypto/elliptic    6063     5746    -317   -4%
                         crypto/rc4     317      295     -22   -6%
                      crypto/sha256     348      312     -36   -9%
                      crypto/sha512     487      451     -36   -6%
                             go/doc    3871     3649    -222   -5%
          go/internal/gccgoimporter    2063     1949    -114   -5%
             go/internal/gcimporter    3253     3096    -157   -4%
                               math    4343     3572    -771  -17%
                         math/cmplx    1580     1274    -306  -18%
                          math/rand     982      926     -56   -5%
              net/internal/socktest    2159     2049    -110   -4%
                            os/exec    7928     7492    -436   -4%
                          os/signal     237      208     -29  -11%
                            os/user     717      682     -35   -4%
            runtime/internal/atomic     728      693     -35   -4%
               runtime/internal/sys    2287     2107    -180   -7%
                               sync    1306     1214     -92   -6%
      
                       all packages 1509255  1465507  -43748   -2%
      
      Change-Id: I98a11521b552166b7f47f2039a29f106748bf5d4
      Reviewed-on: https://go-review.googlesource.com/22580Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      6c11e271
    • Matthew Dempsky's avatar
      cmd/compile: remove unused Bputname function · f04eb356
      Matthew Dempsky authored
      Change-Id: Icecbf9bae8c39670d1ceef62dd94b36e90b27b04
      Reviewed-on: https://go-review.googlesource.com/22570
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      f04eb356
    • Michael Munday's avatar
      cmd/compile: allow 64-bit multiplication with immediates on s390x · 3c8ef0e0
      Michael Munday authored
      MGHI (16-bit signed immediate) is now used where possible for both
      MULLW and MULLD. MGHI is 2-bytes shorter than MSGFI.
      
      Change-Id: I5d0648934f28b3403b1126913fd703d8f62b9e9f
      Reviewed-on: https://go-review.googlesource.com/22398
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBill O'Farrell <billotosyr@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      3c8ef0e0
    • Matthew Dempsky's avatar
      net: ensure dnsConfig search list is rooted · 5fe1b35e
      Matthew Dempsky authored
      Avoids some extra work and string concatenation at query time.
      
      benchmark                                      old allocs     new allocs     delta
      BenchmarkGoLookupIP-32                         154            150            -2.60%
      BenchmarkGoLookupIPNoSuchHost-32               446            442            -0.90%
      BenchmarkGoLookupIPWithBrokenNameServer-32     564            568            +0.71%
      
      benchmark                                      old bytes     new bytes     delta
      BenchmarkGoLookupIP-32                         10824         10704         -1.11%
      BenchmarkGoLookupIPNoSuchHost-32               43140         42992         -0.34%
      BenchmarkGoLookupIPWithBrokenNameServer-32     46616         46680         +0.14%
      
      BenchmarkGoLookupIPWithBrokenNameServer's regression appears to be
      because it's actually only performing 1 LookupIP call, so the extra
      work done parsing the DNS config file doesn't amortize as well as for
      BenchmarkGoLookupIP or BenchmarkGoLOokupIPNoSuchHost, which perform
      2000+ LookupIP calls per run.
      
      Update #15473.
      
      Change-Id: I98c8072f2f39e2f2ccd6c55e9e9bd309f5ad68f8
      Reviewed-on: https://go-review.googlesource.com/22571Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      5fe1b35e
    • Matthew Dempsky's avatar
      net: append ":53" to DNS servers when reading resolv.conf · 4d9bda51
      Matthew Dempsky authored
      Avoids generating some redundant garbage from re-concatenating the
      same string for every DNS query.
      
      benchmark                                      old allocs     new allocs     delta
      BenchmarkGoLookupIP-32                         156            154            -1.28%
      BenchmarkGoLookupIPNoSuchHost-32               456            446            -2.19%
      BenchmarkGoLookupIPWithBrokenNameServer-32     577            564            -2.25%
      
      benchmark                                      old bytes     new bytes     delta
      BenchmarkGoLookupIP-32                         10873         10824         -0.45%
      BenchmarkGoLookupIPNoSuchHost-32               43303         43140         -0.38%
      BenchmarkGoLookupIPWithBrokenNameServer-32     46824         46616         -0.44%
      
      Update #15473.
      
      Change-Id: I3b0173dfedf31bd08eaea1069968b416850864a1
      Reviewed-on: https://go-review.googlesource.com/22556Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      4d9bda51
    • Brad Fitzpatrick's avatar
      os/exec: add Cmd.RunContext and Cmd.WaitContext · 2cc27a7d
      Brad Fitzpatrick authored
      Updates #14660
      
      Change-Id: Ifa5c97ba327ad7ceea0a9a252e3dbd9d079dae54
      Reviewed-on: https://go-review.googlesource.com/22529Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2cc27a7d
    • Adam Langley's avatar
      crypto/tls: allow renegotiation to be handled by a client. · af125a51
      Adam Langley authored
      This change adds Config.Renegotiation which controls whether a TLS
      client will accept renegotiation requests from a server. This is used,
      for example, by some web servers that wish to “add” a client certificate
      to an HTTPS connection.
      
      This is disabled by default because it significantly complicates the
      state machine.
      
      Originally, handshakeMutex was taken before locking either Conn.in or
      Conn.out. However, if renegotiation is permitted then a handshake may
      be triggered during a Read() call. If Conn.in were unlocked before
      taking handshakeMutex then a concurrent Read() call could see an
      intermediate state and trigger an error. Thus handshakeMutex is now
      locked after Conn.in and the handshake functions assume that Conn.in is
      locked for the duration of the handshake.
      
      Additionally, handshakeMutex used to protect Conn.out also. With the
      possibility of renegotiation that's no longer viable and so
      writeRecordLocked has been split off.
      
      Fixes #5742.
      
      Change-Id: I935914db1f185d507ff39bba8274c148d756a1c8
      Reviewed-on: https://go-review.googlesource.com/22475
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      af125a51
    • Keith Randall's avatar
      cmd/compile: reorg copyelim to avoid O(n^2) problem · d610d304
      Keith Randall authored
      Make sure we don't do O(n^2) work to eliminate a chain
      of n copies.
      
      benchmark                     old ns/op       new ns/op     delta
      BenchmarkCopyElim1-8          1418            1406          -0.85%
      BenchmarkCopyElim10-8         5289            5162          -2.40%
      BenchmarkCopyElim100-8        52618           41684         -20.78%
      BenchmarkCopyElim1000-8       2473878         424339        -82.85%
      BenchmarkCopyElim10000-8      269373954       6367971       -97.64%
      BenchmarkCopyElim100000-8     31272781165     104357244     -99.67%
      
      Change-Id: I680f906f70f2ee1a8615cb1046bc510c77d59284
      Reviewed-on: https://go-review.googlesource.com/22535Reviewed-by: 's avatarAlexandru Moșoi <alexandru@mosoi.ro>
      d610d304
    • David Chase's avatar
      cmd/compile: fix.gc.Type.cmp for map.notBucket cmp map.Bucket · 5ec87ba5
      David Chase authored
      Comparison of certain map types could fail to be antisymmetric.
      This corrects that.
      
      Change-Id: I88c6256053ce29950ced4ba4d538e241ee8591fe
      Reviewed-on: https://go-review.googlesource.com/22552
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarjcd . <jcd@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      5ec87ba5
    • Dan Peterson's avatar
      net: change type of dnsConfig.timeout from int to time.Duration · 9faf5cdf
      Dan Peterson authored
      Instead of keeping the desired number of seconds and converting to
      time.Duration for every query, convert to time.Duration when
      building the config.
      
      Updates #15473
      
      Change-Id: Ib24c050b593b3109011e359f4ed837a3fb45dc65
      Reviewed-on: https://go-review.googlesource.com/22548Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      9faf5cdf
    • Aliaksandr Valialkin's avatar
      cmd/vet: improve checking unkeyed fields in composite literals · 22db3c5a
      Aliaksandr Valialkin authored
      - Simplified the code.
      
      - Removed types for slice aliases from composite literals' whitelist, since they
      are properly handled by vet.
      
      Fixes #15408
      Updates #9171
      Updates #11041
      
      Change-Id: Ia1806c9eb3f327c09d2e28da4ffdb233b5a159b0
      Reviewed-on: https://go-review.googlesource.com/22318
      Run-TryBot: Rob Pike <r@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRob Pike <r@golang.org>
      22db3c5a
    • Robert Griesemer's avatar
      cmd/compile: have all or no parameter named in exported signatures · 80e9a7f0
      Robert Griesemer authored
      Binary export format only.
      
      Make sure we don't accidentally export an unnamed parameter
      in signatures which expect all named parameters; otherwise
      we crash during import. Appears to happen for _ (blank)
      parameter names, as observed in method signatures such as
      the one at: x/tools/godoc/analysis/analysis.go:76.
      
      Fixes #15470.
      
      TBR=mdempsky
      
      Change-Id: I1b1184bf08c4c09d8a46946539c4b8c341acdb84
      Reviewed-on: https://go-review.googlesource.com/22543Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      80e9a7f0
    • Robert Griesemer's avatar
      cmd/compile: use correct (field/method) node for position info · e8d4ffb7
      Robert Griesemer authored
      Position info for fields and methods was based on the wrong node
      in the new export format, leading to position info for empty
      file names and 0 line numbers. Use correct node now.
      
      Due to compact delta encoding, there is no difference in export
      format size. In fact, because encoding of "no line changed" is
      uncommon and thus a bit more expensive, in many cases the data
      is now slightly shorter.
      
      Stats for export data size (pachage, before, after, delta%):
      
                                               archive/tar     5128     5025  -1%
                                               archive/zip     7672     7515  -1%
                                                     bufio     3486     3377  -2%
                                                     bytes     4879     4821   0%
                                             cmd/addr2line       66       66   0%
                                                   cmd/api    14033    13970   0%
                                                   cmd/asm       60       60   0%
                                     cmd/asm/internal/arch    11659    11647   0%
                                      cmd/asm/internal/asm    13858    13766   0%
                                    cmd/asm/internal/flags      306      300  -1%
                                      cmd/asm/internal/lex    15684    15623   0%
                                                   cmd/cgo    15383    15298   0%
                                               cmd/compile       63       63   0%
                                cmd/compile/internal/amd64      838      838   0%
                                  cmd/compile/internal/arm     7333     7323   0%
                                cmd/compile/internal/arm64    19953    19951   0%
                                  cmd/compile/internal/big     8943     9043   1%
                                   cmd/compile/internal/gc    57465    56801   0%
                               cmd/compile/internal/mips64      645      645   0%
                                cmd/compile/internal/ppc64      695      695   0%
                                cmd/compile/internal/s390x      553      553   0%
                                  cmd/compile/internal/ssa    34883    34559   0%
                                  cmd/compile/internal/x86      744      744   0%
                                                 cmd/cover     4961     4892   0%
                                                  cmd/dist      145      145   0%
                                                   cmd/doc     8891     8853   0%
                                               cmd/expdump       67       67   0%
                                                   cmd/fix      422      406  -3%
                                                    cmd/go     9951     9747  -1%
                                                 cmd/gofmt       66       66   0%
                                          cmd/internal/bio     6378     6340   0%
                                       cmd/internal/gcprog      684      644  -5%
                                        cmd/internal/goobj     1276     1193  -6%
                                          cmd/internal/obj    12908    12551  -2%
                                      cmd/internal/obj/arm    10074    10053   0%
                                    cmd/internal/obj/arm64    17723    17699   0%
                                     cmd/internal/obj/mips    12573    12530   0%
                                    cmd/internal/obj/ppc64    15352    15330   0%
                                    cmd/internal/obj/s390x    18785    18769   0%
                                      cmd/internal/obj/x86    23586    23551   0%
                                      cmd/internal/objfile    17148    17359   1%
                               cmd/internal/pprof/commands     1948     1930   0%
                                 cmd/internal/pprof/driver    11123    11095   0%
                                  cmd/internal/pprof/fetch     8931     8907   0%
                                 cmd/internal/pprof/plugin    15335    15221   0%
                                cmd/internal/pprof/profile     8493     8370   0%
                                 cmd/internal/pprof/report     9273     9214   0%
                                    cmd/internal/pprof/svg     1589     1589   0%
                             cmd/internal/pprof/symbolizer     8737     8727   0%
                                cmd/internal/pprof/symbolz     8277     8346   1%
                               cmd/internal/pprof/tempfile     4319     4317   0%
                                          cmd/internal/sys      622      603  -2%
        cmd/internal/unvendor/golang.org/x/arch/arm/armasm    79231    79148   0%
        cmd/internal/unvendor/golang.org/x/arch/x86/x86asm    11761    11726   0%
                                                  cmd/link       60       60   0%
                                   cmd/link/internal/amd64    11190    11178   0%
                                     cmd/link/internal/arm      204      204   0%
                                   cmd/link/internal/arm64      210      210   0%
                                      cmd/link/internal/ld    60670    59758  -1%
                                  cmd/link/internal/mips64      213      213   0%
                                   cmd/link/internal/ppc64      211      211   0%
                                   cmd/link/internal/s390x      210      210   0%
                                     cmd/link/internal/x86      203      203   0%
                                                    cmd/nm       57       57   0%
                                               cmd/objdump       64       64   0%
                                                  cmd/pack     4968     4908   0%
                                                 cmd/pprof       63       63   0%
                                                 cmd/trace      828      782  -5%
                                                   cmd/vet    13485    13503   0%
                                cmd/vet/internal/whitelist      109      109   0%
                                                  cmd/yacc     1315     1269  -2%
                                            compress/bzip2     2561     2506  -1%
                                            compress/flate     4906     4748  -2%
                                             compress/gzip     7788     7717   0%
                                              compress/lzw      406      402   0%
                                             compress/zlib     4739     4712   0%
                                            container/heap      265      257  -2%
                                            container/list     1506     1450  -3%
                                            container/ring      556      536  -3%
                                                   context     3552     3527   0%
                                                    crypto      864      834  -2%
                                                crypto/aes      313      311   0%
                                             crypto/cipher     1139     1138   0%
                                                crypto/des      317      315   0%
                                                crypto/dsa     5326     5304   0%
                                              crypto/ecdsa     6383     6364   0%
                                           crypto/elliptic     5983     6063   1%
                                               crypto/hmac      258      256   0%
                                                crypto/md5      722      700  -2%
                                               crypto/rand     4996     4993   0%
                                                crypto/rc4      327      317  -2%
                                                crypto/rsa     6763     6722   0%
                                               crypto/sha1      767      744  -2%
                                             crypto/sha256      348      348   0%
                                             crypto/sha512      487      487   0%
                                             crypto/subtle      620      620   0%
                                                crypto/tls    24344    24083   0%
                                               crypto/x509    17473    17524   0%
                                          crypto/x509/pkix     9682     9596   0%
                                              database/sql     8099     7831  -2%
                                       database/sql/driver     1556     1500  -3%
                                               debug/dwarf     9358     9010  -3%
                                                 debug/elf    28226    27882   0%
                                               debug/gosym     2472     2333  -5%
                                               debug/macho     9032     8830  -1%
                                                  debug/pe     8561     8328  -2%
                                            debug/plan9obj     1347     1295  -3%
                                                  encoding      275      261  -4%
                                          encoding/ascii85      775      738  -4%
                                             encoding/asn1     1280     1246  -2%
                                           encoding/base32     1207     1146  -4%
                                           encoding/base64     1471     1407  -3%
                                           encoding/binary     2430     2386  -1%
                                              encoding/csv     4347     4280  -1%
                                              encoding/gob    13488    13387   0%
                                              encoding/hex      665      646  -2%
                                             encoding/json    11763    11592   0%
                                              encoding/pem      283      273  -3%
                                              encoding/xml    13804    13631   0%
                                                    errors      166      162  -1%
                                                    expvar     1193     1139  -4%
                                                      flag     6896     6964   1%
                                                       fmt     1247     1213  -2%
                                                    go/ast    15797    15473  -1%
                                                  go/build     6497     6336  -1%
                                               go/constant     1846     1820   0%
                                                    go/doc     3942     3871  -1%
                                                 go/format     1854     1850   0%
                                               go/importer     1702     1695   0%
                                 go/internal/gccgoimporter     2084     2063   0%
                                    go/internal/gcimporter     3236     3253   1%
                                                 go/parser     7377     7371   0%
                                                go/printer     2480     2469   0%
                                                go/scanner     3806     3733  -1%
                                                  go/token     3579     3523  -1%
                                                  go/types    26514    26117   0%
                                                      hash      323      295  -8%
                                              hash/adler32      568      554  -1%
                                                hash/crc32      843      825  -1%
                                                hash/crc64      758      739  -2%
                                                  hash/fnv     1583     1530  -2%
                                                      html      113      113   0%
                                             html/template    16957    16937   0%
                                                     image    11470    11045  -3%
                                               image/color     2566     2503  -1%
                                       image/color/palette      165      163   0%
                                                image/draw     2543     2522   0%
                                                 image/gif     3467     3439   0%
                                  image/internal/imageutil     3481     3479   0%
                                                image/jpeg     2725     2717   0%
                                                 image/png     2702     2689   0%
                                         index/suffixarray     5802     5777   0%
                                             internal/race      274      274   0%
                                     internal/singleflight      756      718  -4%
                           internal/syscall/windows/sysdll      162      162   0%
                                          internal/testenv     5288     5276   0%
                                            internal/trace     1853     1768  -4%
                                                        io     3425     3349  -1%
                                                 io/ioutil     4768     4756   0%
                                                       log     4173     4224   1%
                                                log/syslog     5049     4996   0%
                                                      math     4343     4343   0%
                                                  math/big     8779     8817   0%
                                                math/cmplx     1580     1580   0%
                                                 math/rand      944      982   4%
                                                      mime     2313     2298   0%
                                            mime/multipart     5021     4922  -1%
                                      mime/quotedprintable     2049     2008  -1%
                                                       net    19332    19090   0%
                                                  net/http    50404    49542  -1%
                                              net/http/cgi    22533    22637   0%
                                        net/http/cookiejar     5488     5431   0%
                                             net/http/fcgi    20557    20512   0%
                                         net/http/httptest    30350    30255   0%
                                         net/http/httputil    24045    23964   0%
                                         net/http/internal     2579     2550   0%
                                            net/http/pprof    20307    20258   0%
                                     net/internal/socktest     2227     2159  -2%
                                                  net/mail     5086     5054   0%
                                                   net/rpc    28365    28208   0%
                                           net/rpc/jsonrpc    12805    12722   0%
                                                  net/smtp    19975    19887   0%
                                             net/textproto     4558     4466  -1%
                                                   net/url     1391     1326  -4%
                                                        os    10372    10195  -1%
                                                   os/exec     7814     7928   1%
                                                 os/signal      239      237   0%
                                                   os/user      735      717  -1%
                                                      path      391      391   0%
                                             path/filepath     4136     4136   0%
                                                   reflect     6258     5893  -5%
                                                    regexp     5808     5623  -2%
                                             regexp/syntax     3118     3077   0%
                                                   runtime    11685    10912  -6%
                                               runtime/cgo       18       18   0%
                                             runtime/debug     3320     3304   0%
                                   runtime/internal/atomic      728      728   0%
                                      runtime/internal/sys     2287     2287   0%
                                             runtime/pprof      611      587  -3%
                                              runtime/race       19       19   0%
                                             runtime/trace      145      143   0%
                                                      sort     1229     1206  -1%
                                                   strconv     1752     1744   0%
                                                   strings     3809     3775   0%
                                                      sync     1331     1306  -1%
                                               sync/atomic     1135     1130   0%
                                                   syscall    46280    45722   0%
                                                   testing     7558     7284  -3%
                                            testing/iotest     1122     1071  -4%
                                             testing/quick     5656     5609   0%
                                              text/scanner     3367     3312  -1%
                                            text/tabwriter     2810     2755  -1%
                                             text/template    15613    15595   0%
                                       text/template/parse     9499     9040  -4%
                                                      time     5515     5395  -1%
                                                   unicode     4357     4344   0%
                                             unicode/utf16      583      583   0%
                                              unicode/utf8      970      970   0%
                       vendor/golang.org/x/net/http2/hpack     4105     4012  -1%
                                                   average  1524284  1509610   0%
      
      Change-Id: Ibe1ce098c7c575965389c1cad368c62c2cea256a
      Reviewed-on: https://go-review.googlesource.com/22536
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      e8d4ffb7
    • Mikio Hara's avatar
      net: fix misrecongnization of IPv6 zone on Windows · c04bc70c
      Mikio Hara authored
      Fixes #15463.
      
      Change-Id: Ic85886861c650ffcb71240d847941534152b92bc
      Reviewed-on: https://go-review.googlesource.com/22540
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      c04bc70c
    • David du Colombier's avatar
      net/http: skip TestTransportRemovesDeadIdleConnections on Plan 9 · cad04e7e
      David du Colombier authored
      Updates #15464.
      
      Change-Id: If3221034bb10751c6fcf1fbeba401a879c18079f
      Reviewed-on: https://go-review.googlesource.com/22513
      Run-TryBot: David du Colombier <0intro@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      cad04e7e
    • Dave Cheney's avatar
      cmd/compile/internal/gc: unexport {J,S,F,H,B,V}conv · 2da642a9
      Dave Cheney authored
      Updates #15462
      
      Unexport Jconv, Sconv, Fconv, Hconv, Bconv, and VConv as they are
      not referenced outside internal/gc.
      
      Econv was only called by EType.String, so merge it into that method.
      
      Change-Id: Iad9b06078eb513b85a03a43cd9eb9366477643d1
      Reviewed-on: https://go-review.googlesource.com/22531Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2da642a9
  2. 27 Apr, 2016 20 commits
    • Dave Cheney's avatar
      cmd/compile/internal/gc: remove all uses of oconv(op, FmtSharp) · 733f835f
      Dave Cheney authored
      Updates #15462
      
      Replace all use of oconv(op, FmtSharp) with fmt.Printf("%#v", op).
      This removes all the callers of oconv.
      
      Change-Id: Ic3bf22495147f8497c8bada01d681428e2405b0e
      Reviewed-on: https://go-review.googlesource.com/22530Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      733f835f
    • Brad Fitzpatrick's avatar
      net: clarify DialContext's use of its provided context · f08f1cd2
      Brad Fitzpatrick authored
      Fixes #15325
      
      Change-Id: I60137ecf27e236e97734b1730ce29ab23e9fe07f
      Reviewed-on: https://go-review.googlesource.com/22509Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      f08f1cd2
    • Brad Fitzpatrick's avatar
      runtime: fix SetCgoTraceback doc indentation · 06d639e0
      Brad Fitzpatrick authored
      It wasn't rendering as HTML nicely.
      
      Change-Id: I5408ec22932a05e85c210c0faa434bd19dce5650
      Reviewed-on: https://go-review.googlesource.com/22532Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      06d639e0
    • Michael Munday's avatar
      crypto/md5: add s390x assembly implementation · 239fb76e
      Michael Munday authored
      Adapted from md5block_amd64.s.
      
      name                 old speed      new speed      delta
      Hash8Bytes           14.0MB/s ± 1%  39.9MB/s ± 0%  +185.52%   (p=0.000 n=9+10)
      Hash1K                176MB/s ± 1%   661MB/s ± 1%  +274.44%  (p=0.000 n=10+10)
      Hash8K                196MB/s ± 0%   742MB/s ± 1%  +278.35%   (p=0.000 n=10+9)
      Hash8BytesUnaligned  14.2MB/s ± 2%  39.8MB/s ± 0%  +180.06%  (p=0.000 n=10+10)
      Hash1KUnaligned       177MB/s ± 1%   651MB/s ± 0%  +267.38%  (p=0.000 n=10+10)
      Hash8KUnaligned       197MB/s ± 1%   731MB/s ± 1%  +271.73%  (p=0.000 n=10+10)
      
      Change-Id: I45ece98ee10f30fcd192b9c3d743ba61c248f36a
      Reviewed-on: https://go-review.googlesource.com/22505Reviewed-by: 's avatarBill O'Farrell <billotosyr@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      239fb76e
    • Michael Hudson-Doyle's avatar
      cmd/compile: de-dup the gclocals symbols in compiler too · f4d38a87
      Michael Hudson-Doyle authored
      These symbols are de-duplicated in the linker but the compiler generates quite
      many duplicates too: 2425 of 13769 total symbols for runtime.a for example.
      De-duplicating them in the compiler saves the linker a bit of work.
      
      Fixes #14983
      
      Change-Id: I5f18e5f9743563c795aad8f0a22d17a7ed147711
      Reviewed-on: https://go-review.googlesource.com/22293Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      f4d38a87
    • Dave Cheney's avatar
      cmd/compile/internal/gc: remove oconv(op, 0) calls · d3c79d32
      Dave Cheney authored
      Updates #15462
      
      Automatic refactor with sed -e.
      
      Replace all oconv(op, 0) to string conversion with the raw op value
      which fmt's %v verb can print directly.
      
      The remaining oconv(op, FmtSharp) will be replaced with op.GoString and
      %#v in the next CL.
      
      Change-Id: I5e2f7ee0bd35caa65c6dd6cb1a866b5e4519e641
      Reviewed-on: https://go-review.googlesource.com/22499
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      d3c79d32
    • Dan Peterson's avatar
      net: search domain from hostname if no search directives · cbd72318
      Dan Peterson authored
      Fixes #14897
      
      Change-Id: Iffe7462983a5623a37aa0dc6f74c8c70e10c3244
      Reviewed-on: https://go-review.googlesource.com/21464Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      cbd72318
    • Damien Neil's avatar
      syscall: fix uint64->int cast of control message header · 4edb40d4
      Damien Neil authored
      Change-Id: I28980b307d10730b122a4f833809bc400d6aff24
      Reviewed-on: https://go-review.googlesource.com/22525Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4edb40d4
    • Cherry Zhang's avatar
      misc/cgo/testcarchive: fix path of libgo.a for darwin/arm · 78bcdeb6
      Cherry Zhang authored
      After CL 22461, c-archive build on darwin/arm is by default compiled
      with -shared, so update the install path.
      
      Fix build.
      
      Change-Id: Ie93dbd226ed416b834da0234210f4b98bc0e3606
      Reviewed-on: https://go-review.googlesource.com/22507Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      78bcdeb6
    • Austin Clements's avatar
      runtime: don't rescan globals · b49b71ae
      Austin Clements authored
      Currently the runtime rescans globals during mark 2 and mark
      termination. This costs as much as 500µs/MB in STW time, which is
      enough to surpass the 10ms STW limit with only 20MB of globals.
      
      It's also basically unnecessary. The compiler already generates write
      barriers for global -> heap pointer updates and the regular write
      barrier doesn't check whether the slot is a global or in the heap.
      Some less common write barriers do cause problems.
      heapBitsBulkBarrier, which is used by typedmemmove and related
      functions, currently depends on having access to the pointer bitmap
      and as a result ignores writes to globals. Likewise, the
      reflect-related write barriers reflect_typedmemmovepartial and
      callwritebarrier ignore non-heap destinations; though it appears they
      can never be called with global pointers anyway.
      
      This commit makes heapBitsBulkBarrier issue write barriers for writes
      to global pointers using the data and BSS pointer bitmaps, removes the
      inheap checks from the reflection write barriers, and eliminates the
      rescans during mark 2 and mark termination. It also adds a test that
      writes to globals have write barriers.
      
      Programs with large data+BSS segments (with pointers) aren't common,
      but for programs that do have large data+BSS segments, this
      significantly reduces pause time:
      
      name \ 95%ile-time/markTerm              old         new  delta
      LargeBSS/bss:1GB/gomaxprocs:4  148200µs ± 6%  302µs ±52%  -99.80% (p=0.008 n=5+5)
      
      This very slightly improves the go1 benchmarks:
      
      name                      old time/op    new time/op    delta
      BinaryTree17-12              2.62s ± 3%     2.62s ± 4%    ~     (p=0.904 n=20+20)
      Fannkuch11-12                2.15s ± 1%     2.13s ± 0%  -1.29%  (p=0.000 n=18+20)
      FmtFprintfEmpty-12          48.3ns ± 2%    47.6ns ± 1%  -1.52%  (p=0.000 n=20+16)
      FmtFprintfString-12          152ns ± 0%     152ns ± 1%    ~     (p=0.725 n=18+18)
      FmtFprintfInt-12             150ns ± 1%     149ns ± 1%  -1.14%  (p=0.000 n=19+20)
      FmtFprintfIntInt-12          250ns ± 0%     244ns ± 1%  -2.12%  (p=0.000 n=20+18)
      FmtFprintfPrefixedInt-12     219ns ± 1%     217ns ± 1%  -1.20%  (p=0.000 n=19+20)
      FmtFprintfFloat-12           280ns ± 0%     281ns ± 1%  +0.47%  (p=0.000 n=19+19)
      FmtManyArgs-12               928ns ± 0%     923ns ± 1%  -0.53%  (p=0.000 n=19+18)
      GobDecode-12                7.21ms ± 1%    7.24ms ± 2%    ~     (p=0.091 n=19+19)
      GobEncode-12                6.07ms ± 1%    6.05ms ± 1%  -0.36%  (p=0.002 n=20+17)
      Gzip-12                      265ms ± 1%     265ms ± 1%    ~     (p=0.496 n=20+19)
      Gunzip-12                   39.6ms ± 1%    39.3ms ± 1%  -0.85%  (p=0.000 n=19+19)
      HTTPClientServer-12         74.0µs ± 2%    73.8µs ± 1%    ~     (p=0.569 n=20+19)
      JSONEncode-12               15.4ms ± 1%    15.3ms ± 1%  -0.25%  (p=0.049 n=17+17)
      JSONDecode-12               53.7ms ± 2%    53.0ms ± 1%  -1.29%  (p=0.000 n=18+17)
      Mandelbrot200-12            3.97ms ± 1%    3.97ms ± 0%    ~     (p=0.072 n=17+18)
      GoParse-12                  3.35ms ± 2%    3.36ms ± 1%  +0.51%  (p=0.005 n=18+20)
      RegexpMatchEasy0_32-12      72.7ns ± 2%    72.2ns ± 1%  -0.70%  (p=0.005 n=19+19)
      RegexpMatchEasy0_1K-12       246ns ± 1%     245ns ± 0%  -0.60%  (p=0.000 n=18+16)
      RegexpMatchEasy1_32-12      72.8ns ± 1%    72.5ns ± 1%  -0.37%  (p=0.011 n=18+18)
      RegexpMatchEasy1_1K-12       380ns ± 1%     385ns ± 1%  +1.34%  (p=0.000 n=20+19)
      RegexpMatchMedium_32-12      115ns ± 2%     115ns ± 1%  +0.44%  (p=0.047 n=20+20)
      RegexpMatchMedium_1K-12     35.4µs ± 1%    35.5µs ± 1%    ~     (p=0.079 n=18+19)
      RegexpMatchHard_32-12       1.83µs ± 0%    1.80µs ± 1%  -1.76%  (p=0.000 n=18+18)
      RegexpMatchHard_1K-12       55.1µs ± 0%    54.3µs ± 1%  -1.42%  (p=0.000 n=18+19)
      Revcomp-12                   386ms ± 1%     381ms ± 1%  -1.14%  (p=0.000 n=18+18)
      Template-12                 61.5ms ± 2%    61.5ms ± 2%    ~     (p=0.647 n=19+20)
      TimeParse-12                 338ns ± 0%     336ns ± 1%  -0.72%  (p=0.000 n=14+19)
      TimeFormat-12                350ns ± 0%     357ns ± 0%  +2.05%  (p=0.000 n=19+18)
      [Geo mean]                  55.3µs         55.0µs       -0.41%
      
      Change-Id: I57e8720385a1b991aeebd111b6874354308e2a6b
      Reviewed-on: https://go-review.googlesource.com/20829
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
      b49b71ae
    • Austin Clements's avatar
      runtime: make {add,subtract}{b,1} nosplit · 30172f18
      Austin Clements authored
      These are used at the bottom level of various GC operations that must
      not be preempted. To be on the safe side, mark them all nosplit.
      
      Change-Id: I8f7360e79c9852bd044df71413b8581ad764380c
      Reviewed-on: https://go-review.googlesource.com/22504
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
      30172f18
    • David Crawshaw's avatar
      reflect: fix strings of SliceOf-created types · bddfc337
      David Crawshaw authored
      The new type was inheriting the tflagExtraStar from its prototype.
      
      Fixes #15467
      
      Change-Id: Ic22c2a55cee7580cb59228d52b97e1c0a1e60220
      Reviewed-on: https://go-review.googlesource.com/22501Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      bddfc337
    • David Crawshaw's avatar
      reflect: unnamed interface types have no name · 217be5b3
      David Crawshaw authored
      Fixes #15468
      
      Change-Id: I8723171f87774a98d5e80e7832ebb96dd1fbea74
      Reviewed-on: https://go-review.googlesource.com/22524Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      217be5b3
    • Zhongwei Yao's avatar
      cmd/compile: enable const division for arm64 · 74a9bad6
      Zhongwei Yao authored
      performance:
      benchmark                   old ns/op     new ns/op     delta
      BenchmarkDivconstI64-8      8.28          2.70          -67.39%
      BenchmarkDivconstU64-8      8.28          4.69          -43.36%
      BenchmarkDivconstI32-8      8.28          6.39          -22.83%
      BenchmarkDivconstU32-8      8.28          4.43          -46.50%
      BenchmarkDivconstI16-8      5.17          5.17          +0.00%
      BenchmarkDivconstU16-8      5.33          5.34          +0.19%
      BenchmarkDivconstI8-8       3.50          3.50          +0.00%
      BenchmarkDivconstU8-8       3.51          3.50          -0.28%
      
      Fixes #15382
      
      Change-Id: Ibce7b28f0586d593b33c4d4ecc5d5e7e7c905d13
      Reviewed-on: https://go-review.googlesource.com/22292Reviewed-by: 's avatarMichael Munday <munday@ca.ibm.com>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      74a9bad6
    • Robert Griesemer's avatar
      cmd/compile: switch to compact export format by default · 7538b1db
      Robert Griesemer authored
      builtin.go was auto-generated via go generate; all other
      changes were manual.
      
      The new format reduces the export data size by ~65% on average
      for the std library packages (and there is still quite a bit of
      room for improvement).
      
      The average time to write export data is reduced by (at least)
      62% as measured in one run over the std lib, it is likely more.
      
      The average time to read import data is reduced by (at least)
      37% as measured in one run over the std lib, it is likely more.
      There is also room to improve this time.
      
      The compiler transparently handles both packages using the old
      and the new format.
      
      Comparing the -S output of the go build for each package via
      the cmp.bash script (added) shows identical assembly code for
      all packages, but 6 files show file:line differences:
      
      The following files have differences because they use cgo
      and cgo uses different temp. directories for different builds.
      Harmless.
      
      	src/crypto/x509
      	src/net
      	src/os/user
      	src/runtime/cgo
      
      The following files have file:line differences that are not yet
      fully explained; however the differences exist w/ and w/o new export
      format (pre-existing condition). See issue #15453.
      
      	src/go/internal/gccgoimporter
      	src/go/internal/gcimporter
      
      In summary, switching to the new export format produces the same
      package files as before for all practical purposes.
      
      How can you tell which one you have (if you care): Open a package
      (.a) file in an editor. Textual export data starts with a $$ after
      the header and is more or less legible; binary export data starts
      with a $$B after the header and is mostly unreadable. A stand-alone
      decoder (for debugging) is in the works.
      
      In case of a problem, please first try reverting back to the old
      textual format to determine if the cause is the new export format:
      
      For a stand-alone compiler invocation:
      - go tool compile -newexport=0 <files>
      
      For a single package:
      - go build -gcflags="-newexport=0" <pkg>
      
      For make/all.bash:
      - (export GO_GCFLAGS="-newexport=0"; sh make.bash)
      
      Fixes #13241.
      
      Change-Id: I2588cb463be80af22446bf80c225e92ab79878b8
      Reviewed-on: https://go-review.googlesource.com/22123Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      7538b1db
    • Michael Matloob's avatar
      regexp: add a harder regexp to the benchmarks · 70d95a48
      Michael Matloob authored
      This regexp has many parallel alternations
      
      Change-Id: I8044f460aa7d18f20cb0452e9470557b87facd6d
      Reviewed-on: https://go-review.googlesource.com/22471Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      70d95a48
    • Cherry Zhang's avatar
      cmd/link: remove absolute address for c-archive on darwin/arm · 9629f55f
      Cherry Zhang authored
      Now it is possible to build a c-archive as PIC on darwin/arm (this is
      now the default). Then the system linker can link the binary using
      the archive as PIE.
      
      Fixes #12896.
      
      Change-Id: Iad84131572422190f5fa036e7d71910dc155f155
      Reviewed-on: https://go-review.googlesource.com/22461Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      9629f55f
    • Robert Griesemer's avatar
      cmd/compile: don't write pos info for builtin packages · 86c93c98
      Robert Griesemer authored
      TestBuiltin will fail if run on Windows and builtin.go was generated
      on a non-Windows machine (or vice versa) because path names have
      different separators. Avoid problem altogether by not writing pos
      info for builtin packages. It's not needed.
      
      Affects -newexport only.
      
      Change-Id: I8944f343452faebaea9a08b5fb62829bed77c148
      Reviewed-on: https://go-review.googlesource.com/22498
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      86c93c98
    • Keith Randall's avatar
      cmd/compile: don't use line numbers from ONAME and named OLITERALs · a19e60b2
      Keith Randall authored
      The line numbers of ONAMEs are the location of their
      declaration, not their use.
      
      The line numbers of named OLITERALs are also the location
      of their declaration.
      
      Ignore both of these.  Instead, we will inherit the line number from
      the containing syntactic item.
      
      Fixes #14742
      Fixes #15430
      
      Change-Id: Ie43b5b9f6321cbf8cead56e37ccc9364d0702f2f
      Reviewed-on: https://go-review.googlesource.com/22479Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      a19e60b2
    • Zhongwei Yao's avatar
      cmd/asm: fix SIMD register name on arm64 · c9389a10
      Zhongwei Yao authored
      Current V-register range is V32~V63 on arm64. This patch changes it to
      V0~V31.
      
      fix #15465.
      
      Change-Id: I90dab42dea46825ec5d7a8321ec4f6550735feb8
      Reviewed-on: https://go-review.googlesource.com/22520Reviewed-by: 's avatarAram Hăvărneanu <aram@mgk.ro>
      Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c9389a10