1. 30 Oct, 2012 3 commits
    • Brad Fitzpatrick's avatar
      cmd/api: add more tests · e53a2c40
      Brad Fitzpatrick authored
      Feature extraction was tested before, but not the final diffs.
      
      This CL breaks function main into a smaller main + testable
      compareAPI.
      
      No functional changes.
      
      R=golang-dev, adg
      CC=golang-dev
      https://golang.org/cl/6820057
      e53a2c40
    • Brad Fitzpatrick's avatar
      io: add ByteWriter interface · 1d61c9bb
      Brad Fitzpatrick authored
      API change.
      
      R=golang-dev, dsymonds, nigeltao, rsc, r
      CC=golang-dev
      https://golang.org/cl/6760045
      1d61c9bb
    • Nigel Tao's avatar
      image/jpeg: change block from [64]int to [64]int32. · daf43ba4
      Nigel Tao authored
      On 6g/linux:
      benchmark                     old ns/op    new ns/op    delta
      BenchmarkFDCT                      4606         4241   -7.92%
      BenchmarkIDCT                      4187         3923   -6.31%
      BenchmarkDecodeBaseline         3154864      3170224   +0.49%
      BenchmarkDecodeProgressive      4072812      4017132   -1.37%
      BenchmarkEncode                39406920     34596760  -12.21%
      
      Stack requirements before (from 'go tool 6g -S'):
      (scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1352-32
      (writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$5344-24
      
      after:
      (scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1064-32
      (writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$2520-24
      
      Also, in encoder.writeSOS, re-use the yBlock scratch buffer for Cb and
      Cr. This reduces the stack requirement slightly, but also avoids an
      unlucky coincidence where a BenchmarkEncode stack split lands between
      encoder.writeByte and bufio.Writer.WriteByte, which occurs very often
      during Huffman encoding and is otherwise disasterous for the final
      benchmark number. FWIW, the yBlock re-use *without* the s/int/int32/
      change does not have a noticable effect on the benchmarks.
      
      R=r
      CC=golang-dev, rsc
      https://golang.org/cl/6823043
      daf43ba4
  2. 29 Oct, 2012 11 commits
  3. 28 Oct, 2012 2 commits
  4. 27 Oct, 2012 1 commit
  5. 26 Oct, 2012 6 commits
    • Ian Lance Taylor's avatar
      syscall: fix creds_test to reliably close os.File · 5611e8b5
      Ian Lance Taylor authored
      Before this patch the test would close the file descriptor but
      not the os.File.  When the os.File was GC'ed, the finalizer
      would close the file descriptor again.  That would cause
      problems if the same file descriptor were returned by a later
      call to open in another test.
      
      On my system:
      
      > GOGC=30 go test
      --- FAIL: TestPassFD (0.04 seconds)
      passfd_test.go:62: 	FileConn: dup: bad file descriptor
      FAIL
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/6776053
      5611e8b5
    • Shenghou Ma's avatar
      f9902c71
    • Dave Cheney's avatar
      net: avoid allocation in setAddr · 067315c6
      Dave Cheney authored
      setAddr was showing up in profiles due to string concatenation construction the os.File name field. netFD.sysfile's Name() is never used, except in dup() so I believe it is safe to avoid this allocation.
      
      R=mikioh.mikioh, rsc
      CC=golang-dev
      https://golang.org/cl/6742058
      067315c6
    • Dave Cheney's avatar
      cmd/5g: peep.c: reactivate some optimisations · 542dd8b9
      Dave Cheney authored
      Thanks to Minux and Remy for their advice.
      
      The EOR optimisation is applied to a few places in the stdlib.
      
      // hash/crc32/crc32.go
      func update(crc uint32, tab *Table, p []byte) uint32 {
      	crc = ^crc
      	for _, v := range p {
              	crc = tab[byte(crc)^v] ^ (crc >> 8)
      	}
      	return ^crc
      }
      
      before:
      
      --- prog list "update" ---
      0164 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) TEXT        update+0(SB),$12-24
      0165 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) MOVW        tab+4(FP),R8
      0166 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MOVW        crc+0(FP),R0
      0167 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) EOR         $-1,R0,R5
      0168 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        p+8(FP),R0
      0169 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        R0,autotmp_0019+-12(SP)
      
      after:
      
      --- prog list "update" ---
      0164 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) TEXT        update+0(SB),$12-24
      0165 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) MOVW        tab+4(FP),R8
      0166 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MOVW        crc+0(FP),R0
      0167 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MVN         R0,R5
      0168 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        p+8(FP),R0
      0169 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        R0,autotmp_0019+-12(SP)
      
      After 5l has done its work,
      
              crc = ^crc
         3d710:       e59d0014        ldr     r0, [sp, #20]
         3d714:       e3e0b000        mvn     fp, #0
         3d718:       e020500b        eor     r5, r0, fp
      
      becomes
      
              crc = ^crc
         3d710:       e59d0014        ldr     r0, [sp, #20]
         3d714:       e1e05000        mvn     r5, r0
      
      The MOVB optimisation has a small impact on the stdlib, in strconv
      and gzip.
      
      // GZIP (RFC 1952) is little-endian, unlike ZLIB (RFC 1950).
      func put2(p []byte, v uint16) {
              p[0] = uint8(v >> 0)
              p[1] = uint8(v >> 8)
      }
      
      before:
      
      --- prog list "put2" ---
      1369 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) TEXT       put2+0(SB),$0-16
      1370 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) MOVHU      v+12(FP),R4
      1371 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R4,R0
      1372 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R0,R0
      1373 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R0,R1
      1374 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R1,R3
      1375 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVW       $p+0(FP),R1
      
      after:
      
      --- prog list "put2" ---
      1369 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) TEXT       put2+0(SB),$0-16
      1370 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) MOVHU      v+12(FP),R4
      1371 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R4,R0
      1372 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R0,R1
      1373 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R1,R3
      1374 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVW       $p+0(FP),R1
      
      R=remyoudompheng, rsc, minux.ma
      CC=golang-dev
      https://golang.org/cl/6674048
      542dd8b9
    • Rémy Oudompheng's avatar
      reflect: stop thinking that MaxFloat32 overflows float32. · 38070a72
      Rémy Oudompheng authored
      Fixes #4282.
      
      R=golang-dev, minux.ma, rsc
      CC=golang-dev
      https://golang.org/cl/6759052
      38070a72
    • Dmitriy Vyukov's avatar
      runtime: switch to 64-bit goroutine ids · 320df44f
      Dmitriy Vyukov authored
      Fixes #4275.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/6759053
      320df44f
  6. 25 Oct, 2012 4 commits
  7. 24 Oct, 2012 3 commits
  8. 23 Oct, 2012 1 commit
  9. 22 Oct, 2012 9 commits