1. 24 Apr, 2017 13 commits
    • Filippo Valsorda's avatar
      net/http: document Shutdown/Serve return behavior · 3fd976de
      Filippo Valsorda authored
      Change-Id: I9cdf6e7da0fb2d5194426eafa61812ea7a85f52f
      Reviewed-on: https://go-review.googlesource.com/37161Reviewed-by: default avatarDan Peterson <dpiddy@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3fd976de
    • Keith Randall's avatar
      cmd/compile: rotate loops so conditional branch is at the end · 39ce5907
      Keith Randall authored
      Old loops look like this:
         loop:
           CMPQ ...
           JGE exit
           ...
           JMP loop
         exit:
      
      New loops look like this:
          JMP entry
        loop:
          ...
        entry:
          CMPQ ...
          JLT loop
      
      This removes one instruction (the unconditional jump) from
      the inner loop.
      Kinda surprisingly, it matters.
      
      This is a bit different than the peeling that the old obj
      library did in that we don't duplicate the loop exit test.
      We just jump to the test.  I'm not sure if it is better or
      worse to do that (peeling gets rid of the JMP but means more
      code duplication), but this CL is certainly a much simpler
      compiler change, so I'll try this way first.
      
      The obj library used to do peeling before
      CL https://go-review.googlesource.com/c/36205 turned it off.
      
      Fixes #15837 (remove obj instruction reordering)
      The reordering is already removed, this CL implements the only
      part of that reordering that we'd like to keep.
      
      Fixes #14758 (append loop)
      name    old time/op    new time/op    delta
      Foo-12     817ns ± 4%     538ns ± 0%  -34.08%   (p=0.000 n=10+9)
      Bar-12     850ns ±11%     570ns ±13%  -32.88%  (p=0.000 n=10+10)
      
      Update #19595 (BLAS slowdown)
      name                       old time/op  new time/op  delta
      DgemvMedMedNoTransIncN-12  13.2µs ± 9%  10.2µs ± 1%  -22.26%  (p=0.000 n=9+9)
      
      Fixes #19633 (append loop)
      name    old time/op    new time/op    delta
      Foo-12     810ns ± 1%     540ns ± 0%  -33.30%   (p=0.000 n=8+9)
      
      Update #18977 (Fannkuch11 regression)
      name         old time/op    new time/op    delta
      Fannkuch11-8                2.80s ± 0%     3.01s ± 0%  +7.47%   (p=0.000 n=9+10)
      This one makes no sense.  There's strictly 1 less instruction in the
      inner loop (17 instead of 18).  They are exactly the same instructions
      except for the JMP that has been elided.
      
      go1 benchmarks generally don't look very impressive.  But the gains for the
      specific issues above make this CL still probably worth it.
      name                      old time/op    new time/op    delta
      BinaryTree17-8              2.32s ± 0%     2.34s ± 0%  +1.14%    (p=0.000 n=9+7)
      Fannkuch11-8                2.80s ± 0%     3.01s ± 0%  +7.47%   (p=0.000 n=9+10)
      FmtFprintfEmpty-8          44.1ns ± 1%    46.1ns ± 1%  +4.53%  (p=0.000 n=10+10)
      FmtFprintfString-8         67.8ns ± 0%    74.4ns ± 1%  +9.80%   (p=0.000 n=10+9)
      FmtFprintfInt-8            74.9ns ± 0%    78.4ns ± 0%  +4.67%   (p=0.000 n=8+10)
      FmtFprintfIntInt-8          117ns ± 1%     123ns ± 1%  +4.69%   (p=0.000 n=9+10)
      FmtFprintfPrefixedInt-8     160ns ± 1%     146ns ± 0%  -8.22%   (p=0.000 n=8+10)
      FmtFprintfFloat-8           214ns ± 0%     206ns ± 0%  -3.91%    (p=0.000 n=8+8)
      FmtManyArgs-8               468ns ± 0%     497ns ± 1%  +6.09%   (p=0.000 n=8+10)
      GobDecode-8                6.16ms ± 0%    6.21ms ± 1%  +0.76%   (p=0.000 n=9+10)
      GobEncode-8                4.90ms ± 0%    4.92ms ± 1%  +0.37%   (p=0.028 n=9+10)
      Gzip-8                      209ms ± 0%     212ms ± 0%  +1.33%  (p=0.000 n=10+10)
      Gunzip-8                   36.6ms ± 0%    38.0ms ± 1%  +4.03%    (p=0.000 n=9+9)
      HTTPClientServer-8         84.2µs ± 0%    86.0µs ± 1%  +2.14%    (p=0.000 n=9+9)
      JSONEncode-8               13.6ms ± 3%    13.8ms ± 1%  +1.55%   (p=0.003 n=9+10)
      JSONDecode-8               53.2ms ± 5%    52.9ms ± 0%    ~     (p=0.280 n=10+10)
      Mandelbrot200-8            3.78ms ± 0%    3.78ms ± 1%    ~      (p=0.661 n=10+9)
      GoParse-8                  2.89ms ± 0%    2.94ms ± 2%  +1.50%  (p=0.000 n=10+10)
      RegexpMatchEasy0_32-8      68.5ns ± 2%    68.9ns ± 1%    ~     (p=0.136 n=10+10)
      RegexpMatchEasy0_1K-8       220ns ± 1%     225ns ± 1%  +2.41%  (p=0.000 n=10+10)
      RegexpMatchEasy1_32-8      64.7ns ± 0%    64.5ns ± 0%  -0.28%  (p=0.042 n=10+10)
      RegexpMatchEasy1_1K-8       348ns ± 1%     355ns ± 0%  +1.90%  (p=0.000 n=10+10)
      RegexpMatchMedium_32-8      102ns ± 1%     105ns ± 1%  +2.95%  (p=0.000 n=10+10)
      RegexpMatchMedium_1K-8     33.1µs ± 3%    32.5µs ± 0%  -1.75%  (p=0.000 n=10+10)
      RegexpMatchHard_32-8       1.71µs ± 1%    1.70µs ± 1%  -0.84%   (p=0.002 n=10+9)
      RegexpMatchHard_1K-8       51.1µs ± 0%    50.8µs ± 1%  -0.48%  (p=0.004 n=10+10)
      Revcomp-8                   411ms ± 1%     402ms ± 0%  -2.22%   (p=0.000 n=10+9)
      Template-8                 61.8ms ± 1%    59.7ms ± 0%  -3.44%    (p=0.000 n=9+9)
      TimeParse-8                 306ns ± 0%     318ns ± 0%  +3.83%  (p=0.000 n=10+10)
      TimeFormat-8                320ns ± 0%     318ns ± 1%  -0.53%   (p=0.012 n=7+10)
      
      Change-Id: Ifaf29abbe5874e437048e411ba8f7cfbc9e1c94b
      Reviewed-on: https://go-review.googlesource.com/38431
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      39ce5907
    • Brad Fitzpatrick's avatar
      runtime/debug: mark TestSetGCPercent as flaky · 6a48019e
      Brad Fitzpatrick authored
      Updates #20076
      
      Change-Id: I4eb98abbb49174cc6433e5da2c3660893ef88fd1
      Reviewed-on: https://go-review.googlesource.com/41615
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      6a48019e
    • Josh Bleecher Snyder's avatar
      cmd/compile: add -c flag · 22f1b56d
      Josh Bleecher Snyder authored
      This will be used in the future to control backend concurrency.
      See CL 40693.
      
      In the meantime, make it a no-op.
      This should fix the linux-amd64-racecompile builders.
      
      Change-Id: Ibf3b2a7fff6f8f8c94f5fafb26e0500a51c8a4a6
      Reviewed-on: https://go-review.googlesource.com/41614
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      22f1b56d
    • Daniel Theophanes's avatar
      database/sql: allow using a single connection from the database · d234f9a7
      Daniel Theophanes authored
      Databases have the following concepts: Statement, Batch, and Session.
      
      A statement is often a single line like:
      SELECT Amount from Account where ID = 50;
      
      A batch is one or more statements submitted together for the query
      to process. It may be a DELETE, INSERT, two UPDATES and a SELECT in
      a single query text.
      
      A session is usually represented by a single database connection.
      This often is an issue when dealing with scopes in databases.
      Temporary tables and variables can have batch, session, or global
      scope depending on the syntax, database, and use.
      
      Furthermore, some databases (sybase and derivatives in perticular)
      that prevent certain statements from being in the same batch
      and may necessitate being in the same session.
      
      By allowing users to extract a Conn from the database they can manage
      session on their own without hacking around it by making connection
      pools of single connections (a real workaround presented in issue).
      It is tempting to just use a transaction, but this isn't always
      desirable or an option if running an interactive session or
      alter script set that itself starts transactions.
      
      Fixes #18081
      
      Change-Id: I9bdf0796632c48d4bcaef3624c629641984ffaf2
      Reviewed-on: https://go-review.googlesource.com/40694Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d234f9a7
    • Mikio Hara's avatar
      runtime: gofmt -w -s · 42c5f399
      Mikio Hara authored
      Change-Id: I954b0300554786b7026996a21acfec3b6f205e75
      Reviewed-on: https://go-review.googlesource.com/41512
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      Reviewed-by: default avatarMarvin Stenger <marvin.stenger94@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      42c5f399
    • Hiroshi Ioka's avatar
      cmd/compile: fix comments in transformclosure · 3fa133f4
      Hiroshi Ioka authored
      Change-Id: I7a18798180405504dc064424d63dac49634168fb
      Reviewed-on: https://go-review.googlesource.com/41530Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3fa133f4
    • Ilya Tocar's avatar
      math: remove asm version of sincos everywhere, except 386 · bc6459ac
      Ilya Tocar authored
      We have dedicated asm implementation of sincos only on 386 and amd64,
      on everything else we are just jumping to generic version.
      However amd64 version is actually slower than generic one:
      
      Sincos-6               34.4ns ± 0%   24.8ns ± 0%  -27.79%  (p=0.000 n=8+10)
      
      So remove all sincos*.s and keep only generic and 386.
      
      Updates #19819
      
      Change-Id: I7eefab35743729578264f52f6d23ee2c227c92a5
      Reviewed-on: https://go-review.googlesource.com/41200
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      bc6459ac
    • Alberto Donizetti's avatar
      cmd/compile: more error position tests for the typechecker · 1737aef2
      Alberto Donizetti authored
      This change adds line position tests for several yyerror calls in the
      typechecker that are currently not tested in any way.
      
      Untested yyerror calls were found by replacing them with
      
        yerrorl(src.NoXPos, ...)
      
      (thus destroying position information in the error), and then running
      the test suite. No failures means no test coverage for the relevant
      yyerror call.
      
      For #19683
      
      Change-Id: Iedb3d2f02141b332e9bfa76dbf5ae930ad2fddc3
      Reviewed-on: https://go-review.googlesource.com/41477
      Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      1737aef2
    • 张嵩's avatar
      test/chan: add missing flag.Parse in doubleselect.go · 26536b2f
      张嵩 authored
      doubleselect.go defines a flag to control the number of iterations,
      but never called flag.Parse so it was unusable.
      
      Change-Id: Ib5d0c7119e7f7c9a808dcc02d0d9cc6ba5bbc16e
      Reviewed-on: https://go-review.googlesource.com/41299Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      26536b2f
    • Josh Bleecher Snyder's avatar
      cmd/compile: count init functions from 0, not 1 · a73a330c
      Josh Bleecher Snyder authored
      While we're here, do minor style cleanup.
      Also, since we know exactly how many init
      functions there are, use that knowledge.
      
      This is cleanup prior to a more substantive CL.
      
      Change-Id: I2bba60b3c051c852590f798f45e8268f8bc54ca8
      Reviewed-on: https://go-review.googlesource.com/41499
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      a73a330c
    • Josh Bleecher Snyder's avatar
      cmd/compile: lazily create true and false Values in shortcircuit · 79e5ef29
      Josh Bleecher Snyder authored
      It is mildly wasteful to always create values
      that must sometimes then be dead code eliminated.
      Given that it is very easy to avoid, do so.
      
      Noticed when examining a package with thousands
      of generated wrappers, each of which uses
      only a handful of Values to compile.
      
      Change-Id: If02eb4aa786dfa20f7aa43e8d729dad8b3db2786
      Reviewed-on: https://go-review.googlesource.com/41502
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      79e5ef29
    • Josh Bleecher Snyder's avatar
      cmd/compile: break apart dumptypestructs · 976a5ce1
      Josh Bleecher Snyder authored
      dumptypestructs did several different jobs.
      Split them into separate functions
      and call them in turn.
      
      Hand dumptypestructs a list of dcls,
      rather than reading the global.
      
      Rename dumpptabs for (marginal) clarity.
      
      This is groundwork for compiling autogenerated
      functions concurrently.
      
      Passes toolstash-check.
      
      Change-Id: I627a1dffc70a7e4b7b4436ab19af1406267f01dc
      Reviewed-on: https://go-review.googlesource.com/41501
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      976a5ce1
  2. 23 Apr, 2017 7 commits
  3. 22 Apr, 2017 6 commits
  4. 21 Apr, 2017 14 commits