1. 23 Mar, 2016 5 commits
    • Martin Möhrmann's avatar
      fmt: cleanup and optimize doPrintf for simple formats · 49da9312
      Martin Möhrmann authored
      Make a fast path for format strings that do not use
      precision or width specifications or argument indices.
      
      Only check and enforce the restriction to not pad left with zeros
      in code paths that change either f.minus or f.zero.
      
      Consolidate the if chains at the end of the main doPrintf loop
      into a switch statement. Move error printing into extra
      functions to reduce size of this switch statement.
      
      name                             old time/op  new time/op  delta
      SprintfPadding-2                  234ns ± 1%   233ns ± 1%   -0.54%  (p=0.010 n=19+19)
      SprintfEmpty-2                   37.0ns ± 3%  39.1ns ±14%     ~     (p=0.501 n=17+20)
      SprintfString-2                   112ns ± 1%   101ns ± 1%   -9.21%  (p=0.000 n=19+20)
      SprintfTruncateString-2           139ns ± 1%   139ns ± 0%   +0.57%  (p=0.000 n=19+19)
      SprintfQuoteString-2              402ns ± 0%   392ns ± 0%   -2.35%  (p=0.000 n=19+20)
      SprintfInt-2                      114ns ± 1%   102ns ± 2%  -10.92%  (p=0.000 n=20+20)
      SprintfIntInt-2                   177ns ± 2%   155ns ± 2%  -12.67%  (p=0.000 n=18+18)
      SprintfPrefixedInt-2              260ns ± 3%   249ns ± 3%   -4.55%  (p=0.000 n=20+20)
      SprintfFloat-2                    190ns ± 1%   178ns ± 2%   -6.54%  (p=0.000 n=20+20)
      SprintfComplex-2                  533ns ± 1%   517ns ± 3%   -2.95%  (p=0.000 n=20+20)
      SprintfBoolean-2                  102ns ± 1%    93ns ± 2%   -9.30%  (p=0.000 n=20+20)
      SprintfHexString-2                176ns ± 0%   168ns ± 2%   -4.49%  (p=0.000 n=16+19)
      SprintfHexBytes-2                 181ns ± 1%   174ns ± 2%   -4.27%  (p=0.000 n=20+20)
      SprintfBytes-2                    326ns ± 1%   311ns ± 1%   -4.51%  (p=0.000 n=20+20)
      ManyArgs-2                        540ns ± 2%   497ns ± 1%   -8.08%  (p=0.000 n=18+16)
      FprintInt-2                       150ns ± 0%   149ns ± 0%   -0.33%  (p=0.000 n=20+18)
      FprintfBytes-2                    185ns ± 0%   165ns ± 0%  -10.98%  (p=0.000 n=20+18)
      FprintIntNoAlloc-2                113ns ± 0%   112ns ± 0%   -0.88%  (p=0.000 n=20+20)
      
      Change-Id: I9ada8faa1f46aa67ea116a94ab3f4ad3e405c8fe
      Reviewed-on: https://go-review.googlesource.com/20919
      Run-TryBot: Rob Pike <r@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      49da9312
    • Tamir Duberstein's avatar
      database/sql/driver: remove string exclusion · 7162c4d0
      Tamir Duberstein authored
      The exclusion of string from IsScanValue prevents driver authors from
      writing their drivers in such a way that would allow users to
      distinguish between strings and byte arrays returned from a database.
      Such drivers are possible today, but require their authors to deviate
      from the guidance provided by the standard library.
      
      This exclusion has been in place since the birth of this package in
      https://github.com/golang/go/commit/357f2cb1a385f4d1418e48856f9abe0cce,
      but the fakedb implementation shipped in the same commit violates the
      exclusion!
      
      Strictly speaking this is a breaking change, but it increases the set
      of permissible Scan types, and should not cause breakage in practice.
      
      No test changes are necessary because fakedb already exercises this.
      
      Fixes #6497.
      
      Change-Id: I69dbd3a59d90464bcae8c852d7ec6c97bfd120f8
      Reviewed-on: https://go-review.googlesource.com/19439
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7162c4d0
    • Ian Lance Taylor's avatar
      misc/cgo/testcarchive: rewrite test from bash to Go · bac0005e
      Ian Lance Taylor authored
      This is to support https://golang.org/cl/18057, which is going to add
      Windows support to this directory.  Better to write the test in Go then
      to have both test.bash and test.bat.
      
      Update #13494.
      
      Change-Id: I4af7004416309e885049ee60b9470926282f210d
      Reviewed-on: https://go-review.googlesource.com/20892
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      bac0005e
    • Mikio Hara's avatar
      cmd/dist: disable misc/cgo/fortran test on dragonfly · bafa0275
      Mikio Hara authored
      Updates #14544.
      
      Change-Id: I24ab8e6f9ad9d290a672216fc2f50f78c3ed8812
      Reviewed-on: https://go-review.googlesource.com/21014
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      bafa0275
    • Keith Randall's avatar
      cmd/compile: MOVBload and MOVBQZXload are the same op · 68e86e6d
      Keith Randall authored
      No need to have both ops when they do the same thing.
      Just declare MOVBload to zero extend and we can get rid
      of MOVBQZXload.  Same for W and L.
      
      Kind of a followon cleanup for https://go-review.googlesource.com/c/19506/
      Should enable an easier fix for #14920
      
      Change-Id: I7cfac909a8ba387f433a6ae75c050740ebb34d42
      Reviewed-on: https://go-review.googlesource.com/21004
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      68e86e6d
  2. 22 Mar, 2016 18 commits
  3. 21 Mar, 2016 17 commits