1. 08 Sep, 2016 21 commits
  2. 07 Sep, 2016 13 commits
  3. 06 Sep, 2016 6 commits
    • Hiroshi Ioka's avatar
      bytes: make IndexRune faster · e10286ae
      Hiroshi Ioka authored
      re-implement IndexRune by IndexByte and Index which are well optimized
      to get performance gain.
      
      name                  old time/op   new time/op     delta
      IndexRune/10-4         53.2ns ± 1%     29.1ns ± 1%    -45.32%  (p=0.008 n=5+5)
      IndexRune/32-4          191ns ± 1%       27ns ± 1%    -85.75%  (p=0.008 n=5+5)
      IndexRune/4K-4         23.5µs ± 1%      1.0µs ± 1%    -95.77%  (p=0.008 n=5+5)
      IndexRune/4M-4         23.8ms ± 0%      1.0ms ± 2%    -95.90%  (p=0.008 n=5+5)
      IndexRune/64M-4         384ms ± 1%       15ms ± 1%    -95.98%  (p=0.008 n=5+5)
      IndexRuneASCII/10-4    61.5ns ± 0%     10.3ns ± 4%    -83.17%  (p=0.008 n=5+5)
      IndexRuneASCII/32-4     203ns ± 0%       11ns ± 5%    -94.68%  (p=0.008 n=5+5)
      IndexRuneASCII/4K-4    23.4µs ± 0%      0.3µs ± 2%    -98.60%  (p=0.008 n=5+5)
      IndexRuneASCII/4M-4    24.0ms ± 1%      0.3ms ± 1%    -98.60%  (p=0.008 n=5+5)
      IndexRuneASCII/64M-4    386ms ± 2%        6ms ± 1%    -98.57%  (p=0.008 n=5+5)
      
      name                  old speed     new speed       delta
      IndexRune/10-4        188MB/s ± 1%    344MB/s ± 1%    +82.91%  (p=0.008 n=5+5)
      IndexRune/32-4        167MB/s ± 0%   1175MB/s ± 1%   +603.52%  (p=0.008 n=5+5)
      IndexRune/4K-4        174MB/s ± 1%   4117MB/s ± 1%  +2262.71%  (p=0.008 n=5+5)
      IndexRune/4M-4        176MB/s ± 0%   4299MB/s ± 2%  +2340.46%  (p=0.008 n=5+5)
      IndexRune/64M-4       175MB/s ± 1%   4354MB/s ± 1%  +2388.57%  (p=0.008 n=5+5)
      IndexRuneASCII/10-4   163MB/s ± 0%    968MB/s ± 4%   +494.66%  (p=0.008 n=5+5)
      IndexRuneASCII/32-4   157MB/s ± 0%   2974MB/s ± 4%  +1788.59%  (p=0.008 n=5+5)
      IndexRuneASCII/4K-4   175MB/s ± 0%  12481MB/s ± 2%  +7027.71%  (p=0.008 n=5+5)
      IndexRuneASCII/4M-4   175MB/s ± 1%  12510MB/s ± 1%  +7061.15%  (p=0.008 n=5+5)
      IndexRuneASCII/64M-4  174MB/s ± 2%  12143MB/s ± 1%  +6881.70%  (p=0.008 n=5+5)
      
      Change-Id: I0632eadb83937c2a9daa7f0ce79df1dee64f992e
      Reviewed-on: https://go-review.googlesource.com/28537
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e10286ae
    • Austin Clements's avatar
      runtime/debug: enable TestFreeOSMemory on all arches · 8259cf3c
      Austin Clements authored
      TestFreeOSMemory was disabled on many arches because of issue #9993.
      Since that's been fixed, enable the test everywhere.
      
      Change-Id: I298c38c3e04128d9c8a1f558980939d5699bea03
      Reviewed-on: https://go-review.googlesource.com/27403
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarMinux Ma <minux@golang.org>
      8259cf3c
    • Austin Clements's avatar
      syscall: make Getpagesize return page size from runtime · 1b9499b0
      Austin Clements authored
      syscall.Getpagesize currently returns hard-coded page sizes on all
      architectures (some of which are probably always wrong, and some of
      which are definitely not always right). The runtime now has this
      information, queried from the OS during runtime init, so make
      syscall.Getpagesize return the page size that the runtime knows.
      
      Updates #10180.
      
      Change-Id: I4daa6fbc61a2193eb8fa9e7878960971205ac346
      Reviewed-on: https://go-review.googlesource.com/25051
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      1b9499b0
    • Austin Clements's avatar
      runtime: don't hard-code physical page size · 6dda7b2f
      Austin Clements authored
      Now that the runtime fetches the true physical page size from the OS,
      make the physical page size used by heap growth a variable instead of
      a constant. This isn't used in any performance-critical paths, so it
      shouldn't be an issue.
      
      sys.PhysPageSize is also renamed to sys.DefaultPhysPageSize to make it
      clear that it's not necessarily the true page size. There are no uses
      of this constant any more, but we'll keep it around for now.
      
      Updates #12480 and #10180.
      
      Change-Id: I6c23b9df860db309c38c8287a703c53817754f03
      Reviewed-on: https://go-review.googlesource.com/25022
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      6dda7b2f
    • Austin Clements's avatar
      runtime: fetch physical page size from the OS · 276a52de
      Austin Clements authored
      Currently the physical page size assumed by the runtime is hard-coded.
      On Linux the runtime at least fetches the OS page size during init and
      sanity checks against the hard-coded value, but they may still differ.
      On other OSes we wouldn't even notice.
      
      Add support on all OSes to fetch the actual OS physical page size
      during runtime init and lift the sanity check of PhysPageSize from the
      Linux init code to general malloc init. Currently this is the only use
      of the retrieved page size, but we'll add more shortly.
      
      Updates #12480 and #10180.
      
      Change-Id: I065f2834bc97c71d3208edc17fd990ec9058b6da
      Reviewed-on: https://go-review.googlesource.com/25050
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      276a52de
    • Austin Clements's avatar
      runtime: assume 64kB physical pages on ARM · d7de8b6d
      Austin Clements authored
      Currently we assume the physical page size on ARM is 4kB. While this
      is usually true, the architecture also supports 16kB and 64kB physical
      pages, and Linux (and possibly other OSes) can be configured to use
      these larger page sizes.
      
      With Go 1.6, such a configuration could potentially run, but generally
      resulted in memory corruption or random panics. With current master,
      this configuration will cause the runtime to panic during init on
      Linux when it checks the true physical page size (and will still cause
      corruption or panics on other OSes).
      
      However, the assumed physical page size only has to be a multiple of
      the true physical page size, the scavenger can now deal with large
      physical page sizes, and the rest of the runtime can deal with a
      larger assumed physical page size than the true size. Hence, there's
      little disadvantage to conservatively setting the assumed physical
      page size to 64kB on ARM.
      
      This may result in some extra memory use, since we can only return
      memory at multiples of the assumed physical page size. However, it is
      a simple change that should make Go run on systems configured for
      larger page sizes. The following commits will make the runtime query
      the actual physical page size from the OS, but this is a simple step
      there.
      
      Updates #12480.
      
      Change-Id: I851829595bc9e0c76235c847a7b5f62ad82b5302
      Reviewed-on: https://go-review.googlesource.com/25021
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMinux Ma <minux@golang.org>
      d7de8b6d