An error occurred fetching the project authors.
  1. 01 Apr, 2015 2 commits
    • Josh Bleecher Snyder's avatar
      cmd/internal/gc: separate func-only Node fields · 57279ba7
      Josh Bleecher Snyder authored
      Nodes dominate gc's memory usage, but many fields are only used
      for a subset of kinds of nodes. This change pulls out fields
      used only for func-like Nodes. This reduces the size of the
      Node struct on a 64-bit machine from 504 bytes to 416 bytes (-17%).
      
      Compiling the runtime, 1.5% of nodes have a non-nil Func.
      In html/template, 2.7% of nodes have a non-nil Func.
      
      This change introduces an extra alloc and associated GC overhead
      when Func is non-nil. However, when Func is nil, as it almost
      always is, it spares the garbage collector scanning some Node fields.
      Empirically, this change appears to be roughly neutral with regard to GC.
      
      To keep the diff readable, this CL uses an embedded Func field.
      A subsequent CL will unembed the field.
      
      Passes toolstash -cmp.
      
      Change-Id: Ide86aa954b097fb8e6154f0811d3691497477004
      Reviewed-on: https://go-review.googlesource.com/7360Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      57279ba7
    • Josh Bleecher Snyder's avatar
      cmd/5g etc: merge simple case expressions onto fewer lines · b09925b3
      Josh Bleecher Snyder authored
      The c2go translation left a lot of case expressions on separate lines.
      Merge expressions onto single lines subject to these constraints:
      
      * Max 4 clauses, all literals or names
      * Don't move expressions with comments
      
      The change was created by running http://play.golang.org/p/yHajs72h-g:
      
      $ mergecase cmd/internal/{ld,gc,obj}/*.go cmd/internal/obj/*/*.go
      
      Passes toolstash -cmp.
      
      Change-Id: Iba41b390d302e5486e5dc6ba7599a92270676556
      Reviewed-on: https://go-review.googlesource.com/7593Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      b09925b3
  2. 19 Mar, 2015 3 commits
  3. 17 Mar, 2015 3 commits
  4. 13 Mar, 2015 1 commit
    • Matthew Dempsky's avatar
      cmd/internal/gc: remove namebuf variable · 8b3670ff
      Matthew Dempsky authored
      namebuf was a global char buffer in the C version of gc, which was
      useful for providing common storage for constructing symbol and file
      names.  However, now that it's just a global Go string and the string
      data is dynamically allocated anyway, it doesn't serve any purpose
      except to force extra write barriers everytime it's assigned to.
      
      Also, introduce Lookupf(fmt, args...) as shorthand for
      Lookup(fmt.Sprintf(fmt, args...)), which was a very common pattern for
      using namebuf.
      
      Passes "go build -toolexec 'toolstash -cmp' -a std".
      
      Notably, this CL shrinks 6g's text section by ~15kB:
      
      $ size toolstash/6g tool/linux_amd64/6g
         text	   data	    bss	    dec	    hex	filename
      4600805	 605968	 342988	5549761	 54aec1	toolstash/6g
      4585547	 605968	 342956	5534471	 547307	tool/linux_amd64/6g
      
      Change-Id: I98abb44fc7f43a2e2e48425cc9f215cd0be37442
      Reviewed-on: https://go-review.googlesource.com/7080Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      8b3670ff
  5. 11 Mar, 2015 1 commit
    • Dave Cheney's avatar
      cmd/internal/gc: more Node cleanups · e4981819
      Dave Cheney authored
      More cleanups to gc.Node
      
      - make Node.Local a boolean
      - make Type.Local a boolean
      - reduce the size of Node.Esc to a uint8
      
      Reducing the size of Node.Esc shaves ~45mb off the RSS compiling cmd/internal/gc on amd64
      
      before:
              Maximum resident set size (kbytes): 659496
      after:
              Maximum resident set size (kbytes): 612196
      
      - declare gc.Funcdepth as int32
      - declare Node.Funcdepth as int32
      
      In both cases, these were previously machine specific int types. This doesn't result in
      any memory saving at the moment due to struct padding.
      
      Change-Id: Iabef8da15e962fe8b79d7fd3d402fb26ce7ec31c
      Reviewed-on: https://go-review.googlesource.com/7261Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e4981819
  6. 09 Mar, 2015 2 commits
  7. 06 Mar, 2015 2 commits
  8. 05 Mar, 2015 2 commits
  9. 03 Mar, 2015 4 commits
  10. 02 Mar, 2015 1 commit
    • Russ Cox's avatar
      cmd/5g etc: mechanical cleanup · 79f727a7
      Russ Cox authored
      Run rsc.io/grind rev a26569f on C->Go conversions.
      
      The new change in grind is the inlining of goto targets.
      If code says 'goto x' and the block starting at label x is unreachable
      except through that goto and the code can be moved to where
      the goto is without changing the meaning of its variable names,
      grind does that move. Simlarly, a goto to a plain return statement
      turns into that return statement (even if there are other paths to
      the return statement).
      
      Combined, these remove many long-distance gotos, which in turn
      makes it possible to reduce the scope of more variable declarations.
      (Because gotos can't jump across declarations, the gotos were
      keeping the declarations from moving.)
      
      Checked bit-for-bit compatibility with toolstash + buildall.
      
      Reduces compiler runtime in html/template by about 12%.
      
      Change-Id: Id727c0bd7763a61aa22f3daa00aeb8fccbc057a3
      Reviewed-on: https://go-review.googlesource.com/6472Reviewed-by: default avatarAram Hăvărneanu <aram@mgk.ro>
      Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
      79f727a7
  11. 28 Feb, 2015 1 commit
  12. 26 Feb, 2015 2 commits
  13. 25 Feb, 2015 1 commit
  14. 23 Feb, 2015 2 commits
  15. 20 Feb, 2015 1 commit
  16. 17 Feb, 2015 1 commit