1. 24 Mar, 2017 8 commits
  2. 23 Mar, 2017 23 commits
  3. 22 Mar, 2017 9 commits
    • Richard Musiol's avatar
      syscall: use CLONE_VFORK and CLONE_VM · 9e6b79a5
      Richard Musiol authored
      This greatly improves the latency of starting a child process when
      the Go process is using a lot of memory. Even though the kernel uses
      copy-on-write, preparation for that can take up to several 100ms under
      certain conditions. All other goroutines are suspended while starting
      a subprocess so this latency directly affects total throughput.
      
      With CLONE_VM the child process shares the same memory with the parent
      process. On its own this would lead to conflicting use of the same
      memory, so CLONE_VFORK is used to suspend the parent process until the
      child releases the memory when switching to to the new program binary
      via the exec syscall. When the parent process continues to run, one
      has to consider the changes to memory that the child process did,
      namely the return address of the syscall function needs to be restored
      from a register.
      
      A simple benchmark has shown a difference in latency of 16ms vs. 0.5ms
      at 10GB memory usage. However, much higher latencies of several 100ms
      have been observed in real world scenarios. For more information see
      comments on #5838.
      
      Fixes #5838
      
      Change-Id: I6377d7bd8dcd00c85ca0c52b6683e70ce2174ba6
      Reviewed-on: https://go-review.googlesource.com/37439Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      9e6b79a5
    • Sarah Adams's avatar
      encoding/xml: unmarshal allow empty, non-string values · 0a0186fb
      Sarah Adams authored
      When unmarshaling, if an element is empty, eg. '<tag></tag>', and
      destination type is int, uint, float or bool, do not attempt to parse
      value (""). Set to its zero value instead.
      
      Fixes #13417
      
      Change-Id: I2d79f6d8f39192bb277b1a9129727d5abbb2dd1f
      Reviewed-on: https://go-review.googlesource.com/38386Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0a0186fb
    • Kenny Grant's avatar
      net/http: improve speed of default mux · 1295b745
      Kenny Grant authored
      The DefaultServeMux included in net/http uses a map to store routes,
      but iterates all keys for every request to allow longer paths.
      
      This change checks the map for an exact match first.
      
      To check performance was better, BenchmarkServeMux has been added -
      this adds >100 routes and checks the matches.
      
      Exact matches are faster and more predictable on this benchmark
      and on most existing package benchmarks.
      
      https://perf.golang.org/search?q=upload:20170312.1
      
      ServeMux-4  2.02ms ± 2%	0.04ms ± 2%  −98.08%  (p=0.004 n=5+6)
      
      https://perf.golang.org/search?q=upload:20170312.2
      
      ReadRequestChrome-4	184MB/s  ± 8%	186MB/s  ± 1%	~
      ReadRequestCurl-4	45.0MB/s ± 1%	46.2MB/s ± 1%	+2.71%
      Read...Apachebench-4	45.8MB/s ±13%	48.7MB/s ± 1%	~
      ReadRequestSiege-4	63.6MB/s ± 5%	69.2MB/s ± 1%	+8.75%
      ReadRequestWrk-4	30.9MB/s ± 9%	34.4MB/s ± 2%	+11.25%
      
      Change-Id: I8afafcb956f07197419d545a9f1c03ecaa307384
      Reviewed-on: https://go-review.googlesource.com/38057Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1295b745
    • Robert Griesemer's avatar
      cmd/compile/internal/syntax: replace inlined statement lists with syntax.BlockStmt · b5f81eae
      Robert Griesemer authored
      This simplifies the code and removes a premature optimization.
      It increases the amount of allocated syntax.Node space by ~0.4%
      for parsing all of std lib, which is negligible.
      
      Before the change (best of 5 runs):
      
        $ go test -run StdLib -fast
        parsed 1517022 lines (3394 files) in 793.487886ms (1911840 lines/s)
        allocated 387.086Mb (267B/line, 487.828Mb/s)
      
      After the change (best of 5 runs):
      
        $ go test -run StdLib -fast
        parsed 1516911 lines (3392 files) in 805.028655ms (1884294 lines/s)
        allocated 388.466Mb (268B/line, 482.549Mb/s)
      
      Change-Id: Id19d6210fdc62393862ba3b04913352d95c599be
      Reviewed-on: https://go-review.googlesource.com/38439
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      b5f81eae
    • Robert Griesemer's avatar
      cmd/compile/internal/syntax: add position info for { and } braces · e0329248
      Robert Griesemer authored
      This change adds position information for { and } braces in the
      source. There's a 1.9% increase in memory use for syntax.Nodes,
      which is negligible relative to overall compiler memory consumption.
      
      Parsing the std library (using syntax package only) and memory
      consumption before this change (fastest of 5 runs):
      
        $ go test -run StdLib -fast
        parsed 1516827 lines (3392 files) in 780.612335ms (1943124 lines/s)
        allocated 379.903Mb (486.673Mb/s)
      
      After this change (fastest of 5 runs):
      
        $ go test -run StdLib -fast
        parsed 1517022 lines (3394 files) in 793.487886ms (1911840 lines/s)
        allocated 387.086Mb (267B/line, 487.828Mb/s)
      
      While not an exact apples-to-apples comparison (the syntax package
      has changed and is also parsed), the overall impact is small.
      
      Also: Small improvements to nodes_test.go.
      
      Change-Id: Ib8a7f90bbe79de33d83684e33b1bf8dbc32e644a
      Reviewed-on: https://go-review.googlesource.com/38435Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      e0329248
    • Sam Whited's avatar
      encoding/xml: format test output using subtests · ec512340
      Sam Whited authored
      Change-Id: I2d155c838935cd8427abd142a462ff4c56829715
      Reviewed-on: https://go-review.googlesource.com/37948Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ec512340
    • Josselin Costanzi's avatar
      bytes: fix typo in comment · 0d3cd51c
      Josselin Costanzi authored
      Change-Id: Ia739337dc9961422982912cc6a669022559fb991
      Reviewed-on: https://go-review.googlesource.com/38365Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0d3cd51c
    • Josh Bleecher Snyder's avatar
      cmd/compile: eliminate Gins and Naddr · 352e19c9
      Josh Bleecher Snyder authored
      Preparation for eliminating Prog-related globals.
      
      Passes toolstash-check -all.
      
      Updates #15756
      
      Change-Id: Ia199fcb282cc3a84903a6e92a3ce342c5faba79c
      Reviewed-on: https://go-review.googlesource.com/38409
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      352e19c9
    • Carlos Eduardo Seo's avatar
      cmd/compile/internal/ppc64, cmd/compile/internal/ssa: Remove OldArch checks · c644a76e
      Carlos Eduardo Seo authored
      Starting in go1.9, the minimum processor requirement for ppc64 is POWER8.
      Therefore, the checks for OldArch and the code enabled by it are not necessary
      anymore.
      
      Updates #19074
      
      Change-Id: I33d6a78b2462c80d57c5dbcba2e13424630afab4
      Reviewed-on: https://go-review.googlesource.com/38404
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      c644a76e