Skip to content

Instantly share code, notes, and snippets.

@davecheney
Created June 26, 2012 01:36
Show Gist options
  • Select an option

  • Save davecheney/2992609 to your computer and use it in GitHub Desktop.

Select an option

Save davecheney/2992609 to your computer and use it in GitHub Desktop.
package main
import (
"log"
"time"
)
const TODO = 20000000
type Ob struct {
value interface{}
id int64
cas uint64
dirtiness uint32
exptime uint32
seqno uint32
lock_expiry uint32
keylen uint32
key [1]uint8
}
func main() {
m := make(map[int]*Ob, TODO)
now := time.Now()
for i := 0; i < TODO; i++ {
if i%1e7 == 0 {
log.Printf("%d %s", i, time.Since(now))
now = time.Now()
}
m[i] = new(Ob)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment