Created
June 26, 2012 01:36
-
-
Save davecheney/2992609 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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