1. 10 Oct, 2015 2 commits
    • Dave Cheney's avatar
      net/url: make *url.Error implement net.Error · fb3f152c
      Dave Cheney authored
      Fixes #12866
      
      net/http.Client returns some errors wrapped in a *url.Error. To avoid
      the requirement to unwrap these errors to determine if the cause was
      temporary or a timeout, make *url.Error implement net.Error directly.
      
      Change-Id: I1ba84ecc7ad5147a40f056ff1254e60290152408
      Reviewed-on: https://go-review.googlesource.com/15672Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      fb3f152c
    • Joe Tsai's avatar
      compress/flate: deprecate ReadError and WriteError · 2d5601d8
      Joe Tsai authored
      A vast majority of the time, ReadError isn't even returned during
      IO operations. Instead, an unwrapped error will be returned because
      of the ReadByte call on L705. Because DEFLATE streams are primarily
      compressed and require byte for byte Huffman decoding, most of the
      data read from a data stream will go through ReadByte.
      
      Although this is technically an API change, any user reliant on
      this error would not have worked properly anyways due to the fact
      that most IO error are not wrapped. We might as well deprecate
      ReadError. It is useless and actually makes clients that do
      depend on catching IO errors more difficult.
      
      Fixes #11856
      Fixes #12724
      
      Change-Id: Ib5fec5ae215e977c4e85de5701ce6a473d400af8
      Reviewed-on: https://go-review.googlesource.com/14834Reviewed-by: default avatarNigel Tao <nigeltao@golang.org>
      2d5601d8
  2. 09 Oct, 2015 16 commits
  3. 08 Oct, 2015 9 commits
    • Brad Fitzpatrick's avatar
      net/http/httputil: clarify NewSingleHostReverseProxy's Host header behavior · ae315999
      Brad Fitzpatrick authored
      Fixes #10342
      
      Change-Id: I69c69352016a8fd0b62541128c2e86b242ebbe26
      Reviewed-on: https://go-review.googlesource.com/15630Reviewed-by: default avatarMinux Ma <minux@golang.org>
      ae315999
    • Dave Cheney's avatar
      cmd/internal/obj: improve obj.ProgInfo struct layout · b795ce9a
      Dave Cheney authored
      obj.ProgInfo is a field inside obj.Prog, which is currently 320 bytes
      on 64bit platforms. By moving the Flags field below the other fields
      the size of obj.Prog drops into the 288 byte size class, a saving of
      32 bytes per value allocated on the heap.
      
      Change-Id: If8bb12f45328996d7df1d0bac9d1c019d2af73bd
      Reviewed-on: https://go-review.googlesource.com/15522
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      b795ce9a
    • Matthew Dempsky's avatar
      syscall: fix vet warning in UnixRights · 3c2febb7
      Matthew Dempsky authored
      Change-Id: Ic19c94fe0af55e17f6c2fcfd36085ccb1584da6f
      Reviewed-on: https://go-review.googlesource.com/15608Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3c2febb7
    • Ian Lance Taylor's avatar
      cmd/link: pass -Wl,-z,nodelete when creating an ELF shared library · bd7de94d
      Ian Lance Taylor authored
      Go shared libraries do not support dlclose, and there is no likelihood
      that they will suppose dlclose in the future.  Set the DF_1_NODELETE
      flag to tell the dynamic linker to not attempt to remove them from
      memory.  This makes the shared library act as though every call to
      dlopen passed the RTLD_NODELETE flag.
      
      Fixes #12582.
      Update #11100.
      Update #12873.
      
      Change-Id: Id4b6e90a1b54e2e6fc8355b5fb22c5978fc762b4
      Reviewed-on: https://go-review.googlesource.com/15605Reviewed-by: default avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
      bd7de94d
    • Keith Randall's avatar
      runtime: make aeshash more DOS-proof · 91059de0
      Keith Randall authored
      Improve the aeshash implementation to make it harder to engineer collisions.
      
      1) Scramble the seed before xoring with the input string.  This
         makes it harder to cancel known portions of the seed (like the size)
         because it mixes the per-table seed into those other parts.
      
      2) Use table-dependent seeds for all stripes when hashing >16 byte strings.
      
      For small strings this change uses 4 aesenc ops instead of 3, so it
      is somewhat slower.  The first two can run in parallel, though, so
      it isn't 33% slower.
      
      benchmark                            old ns/op     new ns/op     delta
      BenchmarkHash64-12                   10.2          11.2          +9.80%
      BenchmarkHash16-12                   5.71          6.13          +7.36%
      BenchmarkHash5-12                    6.64          7.01          +5.57%
      BenchmarkHashBytesSpeed-12           30.3          31.9          +5.28%
      BenchmarkHash65536-12                2785          2882          +3.48%
      BenchmarkHash1024-12                 53.6          55.4          +3.36%
      BenchmarkHashStringArraySpeed-12     54.9          56.5          +2.91%
      BenchmarkHashStringSpeed-12          18.7          19.2          +2.67%
      BenchmarkHashInt32Speed-12           14.8          15.1          +2.03%
      BenchmarkHashInt64Speed-12           14.5          14.5          +0.00%
      
      Change-Id: I59ea124b5cb92b1c7e8584008257347f9049996c
      Reviewed-on: https://go-review.googlesource.com/14124Reviewed-by: default avatarjcd . <jcd@golang.org>
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      91059de0
    • Michael Hudson-Doyle's avatar
      runtime: adjust the arm64 memmove and memclr to operate by word as much as they can · 168a51b3
      Michael Hudson-Doyle authored
      Not only is this an obvious optimization:
      
      benchmark                           old MB/s     new MB/s     speedup
      BenchmarkMemmove1-4                 35.35        29.65        0.84x
      BenchmarkMemmove2-4                 63.78        52.53        0.82x
      BenchmarkMemmove3-4                 89.72        73.96        0.82x
      BenchmarkMemmove4-4                 109.94       95.73        0.87x
      BenchmarkMemmove5-4                 127.60       112.80       0.88x
      BenchmarkMemmove6-4                 143.59       126.67       0.88x
      BenchmarkMemmove7-4                 157.90       138.92       0.88x
      BenchmarkMemmove8-4                 167.18       231.81       1.39x
      BenchmarkMemmove9-4                 175.23       252.07       1.44x
      BenchmarkMemmove10-4                165.68       261.10       1.58x
      BenchmarkMemmove11-4                174.43       263.31       1.51x
      BenchmarkMemmove12-4                180.76       267.56       1.48x
      BenchmarkMemmove13-4                189.06       284.93       1.51x
      BenchmarkMemmove14-4                186.31       284.72       1.53x
      BenchmarkMemmove15-4                195.75       281.62       1.44x
      BenchmarkMemmove16-4                202.96       439.23       2.16x
      BenchmarkMemmove32-4                264.77       775.77       2.93x
      BenchmarkMemmove64-4                306.81       1209.64      3.94x
      BenchmarkMemmove128-4               357.03       1515.41      4.24x
      BenchmarkMemmove256-4               380.77       2066.01      5.43x
      BenchmarkMemmove512-4               385.05       2556.45      6.64x
      BenchmarkMemmove1024-4              381.23       2804.10      7.36x
      BenchmarkMemmove2048-4              379.06       2814.83      7.43x
      BenchmarkMemmove4096-4              387.43       3064.96      7.91x
      BenchmarkMemmoveUnaligned1-4        28.91        25.40        0.88x
      BenchmarkMemmoveUnaligned2-4        56.13        47.56        0.85x
      BenchmarkMemmoveUnaligned3-4        74.32        69.31        0.93x
      BenchmarkMemmoveUnaligned4-4        97.02        83.58        0.86x
      BenchmarkMemmoveUnaligned5-4        110.17       103.62       0.94x
      BenchmarkMemmoveUnaligned6-4        124.95       113.26       0.91x
      BenchmarkMemmoveUnaligned7-4        142.37       130.82       0.92x
      BenchmarkMemmoveUnaligned8-4        151.20       205.64       1.36x
      BenchmarkMemmoveUnaligned9-4        166.97       215.42       1.29x
      BenchmarkMemmoveUnaligned10-4       148.49       221.22       1.49x
      BenchmarkMemmoveUnaligned11-4       159.47       239.57       1.50x
      BenchmarkMemmoveUnaligned12-4       163.52       247.32       1.51x
      BenchmarkMemmoveUnaligned13-4       167.55       256.54       1.53x
      BenchmarkMemmoveUnaligned14-4       175.12       251.03       1.43x
      BenchmarkMemmoveUnaligned15-4       192.10       267.13       1.39x
      BenchmarkMemmoveUnaligned16-4       190.76       378.87       1.99x
      BenchmarkMemmoveUnaligned32-4       259.02       562.98       2.17x
      BenchmarkMemmoveUnaligned64-4       317.72       842.44       2.65x
      BenchmarkMemmoveUnaligned128-4      355.43       1274.49      3.59x
      BenchmarkMemmoveUnaligned256-4      378.17       1815.74      4.80x
      BenchmarkMemmoveUnaligned512-4      362.15       2180.81      6.02x
      BenchmarkMemmoveUnaligned1024-4     376.07       2453.58      6.52x
      BenchmarkMemmoveUnaligned2048-4     381.66       2568.32      6.73x
      BenchmarkMemmoveUnaligned4096-4     398.51       2669.36      6.70x
      BenchmarkMemclr5-4                  113.83       107.93       0.95x
      BenchmarkMemclr16-4                 223.84       389.63       1.74x
      BenchmarkMemclr64-4                 421.99       1209.58      2.87x
      BenchmarkMemclr256-4                525.94       2411.58      4.59x
      BenchmarkMemclr4096-4               581.66       4372.20      7.52x
      BenchmarkMemclr65536-4              565.84       4747.48      8.39x
      BenchmarkGoMemclr5-4                194.63       160.31       0.82x
      BenchmarkGoMemclr16-4               295.30       630.07       2.13x
      BenchmarkGoMemclr64-4               480.24       1884.03      3.92x
      BenchmarkGoMemclr256-4              540.23       2926.49      5.42x
      
      but it turns out that it's necessary to avoid the GC seeing partially written
      pointers.
      
      It's of course possible to be more sophisticated (using ldp/stp to move 16
      bytes at a time in the core loop and unrolling the tail copying loops being
      the obvious ideas) but I wanted something simple and (reasonably) obviously
      correct.
      
      Fixes #12552
      
      Change-Id: Iaeaf8a812cd06f4747ba2f792de1ded738890735
      Reviewed-on: https://go-review.googlesource.com/14813Reviewed-by: default avatarAustin Clements <austin@google.com>
      168a51b3
    • Alexander Morozov's avatar
      text/template: fix formatting calls in tests · 46b97e75
      Alexander Morozov authored
      Change-Id: I8e94fa57482149f6ea8f13d02ddcc82d6764ddb8
      Reviewed-on: https://go-review.googlesource.com/15496Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      46b97e75
    • Didier Spezia's avatar
      cmd/compile: fix some C to Go translation leftovers · cb0e98b8
      Didier Spezia authored
      Following the C to Go translation, some useless variables
      were left in the code. In fmt.go, this was harmless.
      In lex.go, it broke the error message related to
      non-canonical import paths.
      
      Fix it, and remove the useless variables.
      
      The added test case is ignored in the go/types tests, since
      the behavior of the non-canonical import path check seems
      to be different.
      
      Fixes #11362
      
      Change-Id: Ic9129139ede90357dc79ebf167af638cf44536fa
      Reviewed-on: https://go-review.googlesource.com/15580Reviewed-by: default avatarMarvin Stenger <marvin.stenger94@gmail.com>
      Reviewed-by: default avatarMinux Ma <minux@golang.org>
      Run-TryBot: Minux Ma <minux@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      cb0e98b8
    • Michael Hudson-Doyle's avatar
      cmd/internal/obj, cmd/link, runtime: lots of TLS cleanup · a5cb7624
      Michael Hudson-Doyle authored
      It's particularly nice to get rid of the android special cases in the linker.
      
      Change-Id: I516363af7ce8a6b2f196fe49cb8887ac787a6dad
      Reviewed-on: https://go-review.googlesource.com/14197
      Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      a5cb7624
  4. 07 Oct, 2015 4 commits
  5. 06 Oct, 2015 9 commits