1. 30 Mar, 2016 32 commits
  2. 29 Mar, 2016 8 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: add typArray, typSlice, and typDDDArray · eb98e515
      Josh Bleecher Snyder authored
      These are the first of several convenience
      constructors for types.
      
      They are part of type field encapsulation.
      This removes most external writes to TARRAY Type and Bound fields.
      
      substAny still directly fiddles with the .Type field.
      substAny generally needs access to Type internals.
      It will be moved to type.go in a future CL.
      
      bimport still directly writes the .Type field.
      This is hard to change.
      
      Also of note:
      
      * inl.go contains an (apparently irrelevant) bug fix:
        as.Right was given the wrong type.
        vararrtype was previously unused.
      * I believe that aindex (subr.go) never creates slices,
        but it is safer to keep existing behavior.
        The removal of -1 as a constant there is part
        of hiding that implementation detail.
        Future CLs will finish that job.
      
      Passes toolstash -cmp.
      
      Change-Id: If09bf001a874d7dba08e9ad0bcd6722860af4b91
      Reviewed-on: https://go-review.googlesource.com/21249Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      eb98e515
    • Josh Bleecher Snyder's avatar
      cmd/compile: make only one new Node in defaultlit · f32161da
      Josh Bleecher Snyder authored
      defaultlit and friends sometimes create a new
      OLITERAL node, only to have replace it.
      Thread hints when that is unnecessary.
      
      name       old time/op     new time/op     delta
      Template       318ms ± 6%      322ms ± 4%     ~           (p=0.154 n=24+25)
      Unicode        162ms ± 6%      151ms ± 7%   -6.94%        (p=0.000 n=22+23)
      GoTypes        1.04s ± 1%      1.04s ± 3%     ~           (p=0.136 n=20+25)
      Compiler       5.08s ± 2%      5.10s ± 4%     ~           (p=0.788 n=25+25)
      MakeBash       41.4s ± 1%      41.5s ± 1%     ~           (p=0.084 n=25+25)
      
      name       old user-ns/op  new user-ns/op  delta
      Template        438M ±10%       441M ± 9%     ~           (p=0.418 n=25+25)
      Unicode         272M ± 5%       219M ± 5%  -19.33%        (p=0.000 n=24+21)
      GoTypes        1.51G ± 3%      1.51G ± 3%     ~           (p=0.500 n=25+25)
      Compiler       7.31G ± 3%      7.32G ± 3%     ~           (p=0.572 n=25+24)
      
      name       old alloc/op    new alloc/op    delta
      Template      57.3MB ± 0%     57.2MB ± 0%   -0.16%        (p=0.000 n=25+25)
      Unicode       41.1MB ± 0%     38.7MB ± 0%   -5.81%        (p=0.000 n=25+25)
      GoTypes        191MB ± 0%      191MB ± 0%   -0.06%        (p=0.000 n=25+25)
      Compiler       840MB ± 0%      839MB ± 0%   -0.12%        (p=0.000 n=25+25)
      
      name       old allocs/op   new allocs/op   delta
      Template        500k ± 0%       500k ± 0%   -0.12%        (p=0.000 n=24+25)
      Unicode         400k ± 0%       384k ± 0%   -4.16%        (p=0.000 n=25+25)
      GoTypes        1.50M ± 0%      1.49M ± 0%   -0.05%        (p=0.000 n=25+25)
      Compiler       6.04M ± 0%      6.03M ± 0%   -0.11%        (p=0.000 n=25+25)
      
      Change-Id: I2fda5e072db67ba239848bde827c7deb2ad4abae
      Reviewed-on: https://go-review.googlesource.com/20813Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      f32161da
    • Aliaksandr Valialkin's avatar
      cmd/vet: improve detecting printf-like format argument · ee1b90ad
      Aliaksandr Valialkin authored
      Previously format argument was detected via scanning func type args.
      This didn't work when func type couldn't be determined if the func
      is declared in the external package. Fall back to scanning for
      the first string call argument in this case.
      
      Fixes #14754
      
      Change-Id: I571cc29684cc641bc87882002ef474cf1481e9e2
      Reviewed-on: https://go-review.googlesource.com/21023
      Run-TryBot: Rob Pike <r@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRob Pike <r@golang.org>
      ee1b90ad
    • Michael Munday's avatar
      debug/elf: add s390x relocations · 12fb62a5
      Michael Munday authored
      Change-Id: I8440f69c7f99d65b2f69035c26b4a62104f22bd3
      Reviewed-on: https://go-review.googlesource.com/20874Reviewed-by: 's avatarMinux Ma <minux@golang.org>
      12fb62a5
    • Marvin Stenger's avatar
      all: use &^ operator if possible · d0fb6497
      Marvin Stenger authored
      This is a change improving consistency in the source tree.
      The pattern foo &= ^bar, was only used six times in src/ directory.
      The usage of the supported &^ (bit clear / AND NOT) operator is way more
      common, about factor 10x.
      
      Change-Id: If26a2994fd81d23d42189bee00245eb84e672cf3
      Reviewed-on: https://go-review.googlesource.com/21224Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d0fb6497
    • Alexandre Cesaro's avatar
      mime: fix maximum length of encoded-words · d733cef7
      Alexandre Cesaro authored
      RFC 2047 recommends a maximum length of 75 characters for
      encoded-words. Due to a bug, encoded-words were limited to 77
      characters instead of 75.
      
      Change-Id: I2ff9d013ab922df6fd542464ace70b1c46dc7ae7
      Reviewed-on: https://go-review.googlesource.com/20918Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d733cef7
    • Shahar Kohanim's avatar
      cmd/link: remove some more dead fields from Pcln · 1b6402ea
      Shahar Kohanim authored
      Change-Id: Ibb98de29d84a605fb1588c7dc11ad66e3965a137
      Reviewed-on: https://go-review.googlesource.com/21223Reviewed-by: 's avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
      Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
      1b6402ea
    • Klaus Post's avatar
      compress/flate: add pure huffman deflater · 42ad1dc0
      Klaus Post authored
      Add a "HuffmanOnly" compression level, where the input is
      only entropy encoded.
      
      The output is fully inflate compatible. Typical compression
      is reduction is about 50% of typical level 1 compression, however
      the compression time is very stable, and does not vary as much as
      nearly as much level 1 compression (or Snappy).
      
      This mode is useful for:
       * HTTP compression in a CPU limited environment.
       * Entropy encoding Snappy compressed data, for archiving, etc.
       * Compression where compression time needs to be predictable.
       * Fast network transfer.
      
      Snappy "usually" performs inbetween this and level 1 compression-wise,
      but at the same speed as "Huffman", so this is not a replacement,
      but a good supplement for Snappy, since it usually can compress
      Snappy output further.
      
      This is implemented as level -2, since this would be too much of a
      compression reduction to replace level 1.
      
      >go test -bench=Encode -cpu=1
      BenchmarkEncodeDigitsHuffman1e4            30000             52334 ns/op         191.08 MB/s
      BenchmarkEncodeDigitsHuffman1e5             3000            518343 ns/op         192.92 MB/s
      BenchmarkEncodeDigitsHuffman1e6              300           5356884 ns/op         186.68 MB/s
      BenchmarkEncodeDigitsSpeed1e4               5000            324214 ns/op          30.84 MB/s
      BenchmarkEncodeDigitsSpeed1e5                500           3952614 ns/op          25.30 MB/s
      BenchmarkEncodeDigitsSpeed1e6                 30          40760350 ns/op          24.53 MB/s
      BenchmarkEncodeDigitsDefault1e4             5000            387056 ns/op          25.84 MB/s
      BenchmarkEncodeDigitsDefault1e5              300           5950614 ns/op          16.80 MB/s
      BenchmarkEncodeDigitsDefault1e6               20          63842195 ns/op          15.66 MB/s
      BenchmarkEncodeDigitsCompress1e4            5000            391859 ns/op          25.52 MB/s
      BenchmarkEncodeDigitsCompress1e5             300           5707112 ns/op          17.52 MB/s
      BenchmarkEncodeDigitsCompress1e6              20          59839465 ns/op          16.71 MB/s
      BenchmarkEncodeTwainHuffman1e4             20000             73498 ns/op         136.06 MB/s
      BenchmarkEncodeTwainHuffman1e5              2000            595892 ns/op         167.82 MB/s
      BenchmarkEncodeTwainHuffman1e6               200           6059016 ns/op         165.04 MB/s
      BenchmarkEncodeTwainSpeed1e4                5000            321212 ns/op          31.13 MB/s
      BenchmarkEncodeTwainSpeed1e5                 500           2823873 ns/op          35.41 MB/s
      BenchmarkEncodeTwainSpeed1e6                  50          27237864 ns/op          36.71 MB/s
      BenchmarkEncodeTwainDefault1e4              3000            454634 ns/op          22.00 MB/s
      BenchmarkEncodeTwainDefault1e5               200           6859537 ns/op          14.58 MB/s
      BenchmarkEncodeTwainDefault1e6                20          71547405 ns/op          13.98 MB/s
      BenchmarkEncodeTwainCompress1e4             3000            462307 ns/op          21.63 MB/s
      BenchmarkEncodeTwainCompress1e5              200           7534992 ns/op          13.27 MB/s
      BenchmarkEncodeTwainCompress1e6               20          80353365 ns/op          12.45 MB/s
      PASS
      ok      compress/flate  55.333s
      
      Change-Id: I8e12ad13220e50d4cf7ddba6f292333efad61b0c
      Reviewed-on: https://go-review.googlesource.com/20982Reviewed-by: 's avatarJoe Tsai <joetsai@digital-static.net>
      Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
      42ad1dc0