I hereby claim:
- I am deckarep on github.
- I am deckarep (https://keybase.io/deckarep) on keybase.
- I have a public key ASCILfCZPwyCR_n1T7aot_Nq9xjLhXrkYoKZRX-deNXGrwo
To claim this, I am signing this object:
| // Code generated by protoc-gen-gogo. DO NOT EDIT. | |
| // source: dog.proto | |
| package main | |
| import ( | |
| encoding_binary "encoding/binary" | |
| fmt "fmt" | |
| github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" | |
| proto "github.com/gogo/protobuf/proto" |
I hereby claim:
To claim this, I am signing this object:
| <!doctype html> | |
| <html class="no-js" lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>d3 webGL force graph with PIXI.js</title> | |
| <meta name="description" content=""> | |
| <meta name="theme-color" content="#000000"> | |
| </head> | |
| <body> | |
| <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default"></script> |
| func benchmarkRegularStableKeys(b *testing.B, workerCount int) { | |
| runtime.GOMAXPROCS(workerCount) | |
| rm := NewRegularIntMap() | |
| populateMap(b.N, rm) | |
| var wg sync.WaitGroup | |
| wg.Add(workerCount) | |
| // Holds our final results, to prevent compiler optimizations. |
| func BenchmarkLoadRegularFound(b *testing.B) { | |
| nums := nrand(b.N) | |
| rm := NewRegularIntMap() | |
| for _, v := range nums { | |
| rm.Store(v, v) | |
| } | |
| currentResult := 0 | |
| b.ResetTimer() |
| func BenchmarkDeleteRegular(b *testing.B) { | |
| nums := nrand(b.N) | |
| rm := NewRegularIntMap() | |
| for _, v := range nums { | |
| rm.Store(v, v) | |
| } | |
| b.ResetTimer() | |
| for _, v := range nums { | |
| rm.Delete(v) |
| func nrand(n int) []int { | |
| i := make([]int, n) | |
| for ind := range i { | |
| i[ind] = rand.Int() | |
| } | |
| return i | |
| } | |
| func BenchmarkStoreRegular(b *testing.B) { | |
| nums := nrand(b.N) |
| func syncMapUsage() { | |
| fmt.Println("sync.Map test (Go 1.9+ only)") | |
| fmt.Println("----------------------------") | |
| // Create the threadsafe map. | |
| var sm sync.Map | |
| // Fetch an item that doesn't exist yet. | |
| result, ok := sm.Load("hello") | |
| if ok { |
| package RegularIntMap | |
| type RegularIntMap struct { | |
| sync.RWMutex | |
| internal map[int]int | |
| } | |
| func NewRegularIntMap() *RegularIntMap { | |
| return &RegularIntMap{ | |
| internal: make(map[int]int), |
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "os" | |
| "os/signal" | |
| "sync/atomic" | |
| "time" | |
| ) |