1. 01 Sep, 2012 6 commits
    • Daniel Morsing's avatar
      cmd/gc: Suggest *T in error for x.(T) if it would work. · 1c2021ca
      Daniel Morsing authored
      Accomplished by synchronizing the formatting of conversion errors between typecheck.c and subr.c
      
      Fixes #3984.
      
      R=golang-dev, remyoudompheng, rsc
      CC=golang-dev
      https://golang.org/cl/6500064
      1c2021ca
    • Rémy Oudompheng's avatar
      cmd/6g, cmd/8g: eliminate short integer arithmetic when possible. · 8f3c2055
      Rémy Oudompheng authored
      Fixes #3909.
      Fixes #3910.
      
      R=rsc, nigeltao
      CC=golang-dev
      https://golang.org/cl/6442114
      8f3c2055
    • Russ Cox's avatar
      cmd/go: be clear that import loops are bad · 508bfda6
      Russ Cox authored
      There was mail on golang-nuts a few weeks ago
      from someone who understood the message perfectly
      and knew he had a cyclic dependency but assumed
      that Go, like Python or Java, was supposed to handle it.
      
      R=golang-dev, bradfitz, dave
      CC=golang-dev
      https://golang.org/cl/6488069
      508bfda6
    • Rémy Oudompheng's avatar
      strconv: faster FormatFloat for fixed number of digits. · c1c02796
      Rémy Oudompheng authored
      The performance improvement applies to the case where
      prec >= 0 and fmt is 'e' or 'g'.
      
      Additional minor optimisations are included. A small
      performance impact happens in some cases due to code
      refactoring.
      
      benchmark                              old ns/op    new ns/op    delta
      BenchmarkAppendFloat64Fixed1                 623          235  -62.28%
      BenchmarkAppendFloat64Fixed2                1050          272  -74.10%
      BenchmarkAppendFloat64Fixed3                3723          243  -93.47%
      BenchmarkAppendFloat64Fixed4               10285          274  -97.34%
      
      BenchmarkAppendFloatDecimal                  190          206   +8.42%
      BenchmarkAppendFloat                         387          377   -2.58%
      BenchmarkAppendFloatExp                      397          339  -14.61%
      BenchmarkAppendFloatNegExp                   377          336  -10.88%
      BenchmarkAppendFloatBig                      546          482  -11.72%
      
      BenchmarkAppendFloat32Integer                188          204   +8.51%
      BenchmarkAppendFloat32ExactFraction          329          298   -9.42%
      BenchmarkAppendFloat32Point                  400          372   -7.00%
      BenchmarkAppendFloat32Exp                    369          306  -17.07%
      BenchmarkAppendFloat32NegExp                 372          305  -18.01%
      
      R=golang-dev, rsc
      CC=golang-dev, remy
      https://golang.org/cl/6462049
      c1c02796
    • Marcel van Lohuizen's avatar
      exp/locale/collate: Added functionality to parse and process LDML files · 5a78e5ea
      Marcel van Lohuizen authored
      for both locale-specific exemplar characters and tailorings to
      the collation table.
      Some specifices:
      - Moved stringSet to the beginning of the file and added some functionality
        to parse command line files.
      - openReader now modifies the input URL for localFiles to guarantee that
        any http source listed in the generated file is indeed this source.
      - Note that the implementation of the Tailoring API used by maketables.go
        is not yet checked in. So for now adding tailorings are simply no-ops.
      - The generated file of exemplar characters will be used somewhere else.
        Here is a snippet of how the body of the generated file looks like:
      
      type exemplarType int
      const (
              exCharacters exemplarType = iota
              exContractions
              exPunctuation
              exAuxiliary
              exCurrency
              exIndex
              exN
      )
      
      var exemplarCharacters = map[string][exN]string{
              "af": [exN]string{
                      0: "a á â b c d e é è ê ë f g h i î ï j k l m n o ô ö p q r s t u û v w x y z",
                      3: "á à â ä ã æ ç é è ê ë í ì î ï ó ò ô ö ú ù û ü ý",
                      4: "a b c d e f g h i j k l m n o p q r s t u v w x y z",
              },
              ...
      }
      
      R=r
      CC=golang-dev
      https://golang.org/cl/6501070
      5a78e5ea
    • Marcel van Lohuizen's avatar
      exp/locale/collate: first changes that introduce implementation of tailorings: · 18aa55c1
      Marcel van Lohuizen authored
      - Elements in the array are now sorted as a linked list.  This makes it easier to
        apply tailorings.
      - Added code to sort entries by collation elements.
      - Added logical reset points.  This is used for tailoring relative to certain
        properties, rather than characters.
      
      NOTE: all code for type entry should now be in order.go.  To keep the diffs for
      this CL reasonable, though, the existing code is left in builder.go.  I'll move
      this in a separate CL.
      
      R=r
      CC=golang-dev
      https://golang.org/cl/6493063
      18aa55c1
  2. 31 Aug, 2012 17 commits
  3. 30 Aug, 2012 5 commits
    • Robert Griesemer's avatar
      d6c69dc6
    • Rob Pike's avatar
      cmd/gc: string conversion for surrogates · 363ec80d
      Rob Pike authored
      This is required by the spec to produce the replacement char.
      The fix lies in lib9's rune code.
      
      R=golang-dev, nigeltao, rsc
      CC=golang-dev
      https://golang.org/cl/6443109
      363ec80d
    • Rob Pike's avatar
      path: improve documentation for Dir · b7627d3d
      Rob Pike authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/6495059
      b7627d3d
    • Dmitriy Vyukov's avatar
      net/rpc: protect serviceMap with RWMutex · e61c047c
      Dmitriy Vyukov authored
      R=r, r
      CC=golang-dev
      https://golang.org/cl/6494044
      e61c047c
    • Rob Pike's avatar
      text/template: make spaces significant · de13e8dc
      Rob Pike authored
      Other than catching an error case that was missed before, this
      CL introduces no changes to the template language or API.
      
      For simplicity, templates use spaces as argument separators.
      This means that spaces are significant: .x .y is not the same as .x.y.
      In the existing code, these cases are discriminated by the lexer,
      but that means for instance that (a b).x cannot be distinguished
      from (a b) .x, which is lousy. Although that syntax is not
      supported yet, we want to support it and this CL is a necessary
      step.
      
      This CL emits a "space" token (actually a run of spaces) from
      the lexer so the parser can discriminate these cases. It therefore
      fixes a couple of undisclosed bugs ("hi".x is now an error) but
      doesn't otherwise change the language. Later CLs will amend
      the grammar to make .X a proper operator.
      
      There is one unpleasantness: With space a token, three-token
      lookahead is now required when parsing variable declarations
      to discriminate them from plain variable references. Otherwise
      the change isn't bad.
      
      The CL also moves the debugging print code out of the lexer
      into the test, which is the only place it's needed or useful.
      
      Step towards resolving issue 3999.
      It still remains to move field chaining out of the lexer
      and into the parser and make field access an operator.
      
      R=golang-dev, dsymonds
      CC=golang-dev
      https://golang.org/cl/6492054
      de13e8dc
  4. 29 Aug, 2012 5 commits
  5. 28 Aug, 2012 4 commits
    • Dave Cheney's avatar
      net/http/httputil: fix race in DumpRequestOut · f8d4bb88
      Dave Cheney authored
      Fixes #3892.
      
      Swapping the order of the writers inside the MultiWriter ensures
      the request will be written to buf before http.ReadRequest completes.
      
      The fencedBuffer is not required to make the test pass on
      any machine that I have access too, but as the buf is shared
      across goroutines, I think it is necessary for correctness.
      
      R=bradfitz, fullung, franciscossouza
      CC=golang-dev
      https://golang.org/cl/6483061
      f8d4bb88
    • Rob Pike's avatar
      test/bench/shootout: pidigits is much faster · d199c34c
      Rob Pike authored
      Also fix a bug in the script (s/runonly/run/)
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/6501051
      d199c34c
    • Mikio Hara's avatar
      net: delete unused socket-level option helpers · ddbc85ce
      Mikio Hara authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/6499043
      ddbc85ce
    • Christopher Swenson's avatar
      math/big: Replace RCLQ + ANDQ with SETCS in unrolled arithmetic assembly. · baf426f1
      Christopher Swenson authored
      benchmark             old ns/op    new ns/op    delta
      BenchmarkAddVW_1              8            8   +0.60%
      BenchmarkAddVW_2             10            9   -8.64%
      BenchmarkAddVW_3             10           10   -4.63%
      BenchmarkAddVW_4             10           11   +3.67%
      BenchmarkAddVW_5             11           12   +5.98%
      BenchmarkAddVW_1e1           18           20   +6.38%
      BenchmarkAddVW_1e2          129          115  -10.85%
      BenchmarkAddVW_1e3         1270         1089  -14.25%
      BenchmarkAddVW_1e4        13376        12145   -9.20%
      BenchmarkAddVW_1e5       130392       125260   -3.94%
      
      benchmark              old MB/s     new MB/s  speedup
      BenchmarkAddVW_1        7709.10      7661.92    0.99x
      BenchmarkAddVW_2       12451.10     13604.00    1.09x
      BenchmarkAddVW_3       17727.81     18721.54    1.06x
      BenchmarkAddVW_4       23552.64     22708.81    0.96x
      BenchmarkAddVW_5       27411.40     25816.22    0.94x
      BenchmarkAddVW_1e1     34063.19     32023.06    0.94x
      BenchmarkAddVW_1e2     49529.97     55360.55    1.12x
      BenchmarkAddVW_1e3     50380.44     58764.18    1.17x
      BenchmarkAddVW_1e4     47843.59     52696.10    1.10x
      BenchmarkAddVW_1e5     49082.60     51093.66    1.04x
      
      R=gri, rsc, r
      CC=golang-dev
      https://golang.org/cl/6480063
      baf426f1
  6. 27 Aug, 2012 3 commits