News for hackers. Stuff that matters.
Re:Go 1.1 performance improvements by enneff on Monday May 20, 2013 @11:51PM (#5741805)
Correct.

It's a regression in that benchmark, but it's possible that improvements elsewhere will still make your program faster overall. For instance, gob is mostly used in network servers, and the scheduler improvements may be good enough to overshadow the gob regression.

We're always looking for more real-world performance measurements. If you have any programs whose performance has regressed between 1.0 and 1.1, we'd like to hear about it.

Re:Go 1.1 performance improvements by jgrahamc on Tuesday May 21, 2013 @06:11AM (#5742752)
CloudFlare uses gob a lot in a latency sensitive way and so I figured I would run my own test with a small program like this. The 'Thing' structure is meant to mirror the sort of items we send using gob.

  package main

  import (
    "bytes"
    "encoding/gob"
    "fmt"
    "time"
  )

  type Thing struct {
    B []byte
    S string
    I int
  }

  func main() {
    var n bytes.Buffer
    e := gob.NewEncoder(&n)

    t := Thing{[]byte(p), p, 42}

    count := 10000000
    mark := time.Now()
    for i := 0; i < count; i++ {
      if err := e.Encode(t); err != nil {
        panic(err)
      }

      n.Truncate(0)
      t.I += 1
    }

    fmt.Printf("%f\n", time.Since(mark).Seconds())
  }

  var p = `` // Cut for space but is a 15,344 byte web page as a string
I had two versions of Go on my machine: 16c93a202587 (http://code.google.com/p/go/source/detail?r=16c93a202587f499... from March 1) and 9d60132d7784 (https://code.google.com/p/go/source/detail?r=9d60132d7784 from yesterday).

Doing 10 runs of each and averaging the reported duration I see:

    16c93a202587: 29.4829122s
    9d60132d7784: 26.4422463s
So, in my test Go 1.1 (represented by 9d60132d7784) is 10% faster than a previous version from March.

Tests were done on a AMD64 Linux.

Re:Go 1.1 performance improvements by jemfinch on Tuesday May 21, 2013 @10:14AM (#5743726)
> Doing 10 runs of each and averaging the reported duration

I wish people would stop doing that. Your program is doing the same work in all benchmarking runs; any variance in the runtime is a result of factors you're probably not interested in measuring, like kernel scheduling nuances or what CPUs your benchmark happened to run on. You should take the min of microbenchmark duration, not the average.

Re:Go 1.1 performance improvements by paulsmith on Tuesday May 21, 2013 @08:36AM (#5743176)
How do you install multiple versions of Go on a single machine?
Re:Go 1.1 performance improvements by JulienSchmidt on Tuesday May 21, 2013 @10:00AM (#5743635)
Just install them in different paths. You have three options then:

1. Use absolute paths for the Go tools: $ /home/paul/go-tip/bin/go run myfile.go

2. Set the GOPATH every time accordingly (script)

3. Rename the folder. For example on my Windows PC I have GOPATH pointed to D:/dev/go. In the dev folder I have Go installations in go/ (currently 1.1), go1.0.3 (guess the version) and go-tip. If I want to use another version I just rename the folder to go/