Skip to content

Instantly share code, notes, and snippets.

View yifan-gu's full-sized avatar

Yifan Gu yifan-gu

  • Anchorage Digital
  • San Francisco
View GitHub Profile
@yifan-gu
yifan-gu / result
Created July 18, 2014 22:09
url escape
$ go run testurlparse.go
$ url http://localhost:5050/slave%281%29/executor
$ path /slave(1)/executo
@yifan-gu
yifan-gu / bench.txt
Last active August 29, 2015 14:04
Benchmark for messenger
$ go test -v -run=Bench* -bench=. -cpu=4 -send-routines=4
PASS
BenchmarkMessengerSendSmallMessage-4 50000 58833 ns/op
BenchmarkMessengerSendMediumMessage-4 50000 58367 ns/op
BenchmarkMessengerSendBigMessage-4 50000 56553 ns/op
BenchmarkMessengerSendLargeMessage-4 50000 56711 ns/op
BenchmarkMessengerSendMixedMessage-4 50000 61250 ns/op
BenchmarkMessengerSendRecvSmallMessage-4 50000 46408 ns/op
BenchmarkMessengerSendRecvMediumMessage-4 50000 44517 ns/op
BenchmarkMessengerSendRecvBigMessage-4 50000 45937 ns/op

$ cd /sys/fs/cgroup/cpu

$ ls mesos docker

$ cat mesos/cpu.shares 1024

$ cat docker/cpu.shares 1024

@yifan-gu
yifan-gu / continuation.go
Last active August 29, 2015 14:05
continuation
func processLoop() {
for {
// process the next event.
}
}
func (f *foo) a () {
// check a bunch of assumptions.
go func () {
@yifan-gu
yifan-gu / hyparview_bootstraping_simulator.go
Created August 23, 2014 21:23
simulator for HyParView protocol bootstraping
package main
import (
"fmt"
"math/rand"
"sync/atomic"
"time"
)
var makeup int32
@yifan-gu
yifan-gu / random_indgree_distribution.go
Created August 23, 2014 21:24
Shows the distribution of indgree using random picking
package main
import (
"crypto/rand"
"fmt"
"math/big"
"sync"
)
type member struct {
@yifan-gu
yifan-gu / strict.log
Created August 29, 2014 02:53
strict (5,5, 10000)
0 makeup: 89727 breakup: 68091
1 makeup: 1992 breakup: 2043
2 makeup: 64 breakup: 62
3 makeup: 1923 breakup: 1955
4 makeup: 94 breakup: 90
5 makeup: 88 breakup: 94
6 makeup: 93 breakup: 88
7 makeup: 88 breakup: 95
8 makeup: 92 breakup: 89
9 makeup: 84 breakup: 89
@yifan-gu
yifan-gu / loosen1.log
Created August 29, 2014 02:55
loosen (5,6, 10000)
0 makeup: 54097 breakup: 25033
1 makeup: 57 breakup: 83
2 makeup: 76 breakup: 79
3 makeup: 71 breakup: 51
4 makeup: 56 breakup: 80
5 makeup: 71 breakup: 32
6 makeup: 49 breakup: 70
7 makeup: 50 breakup: 38
8 makeup: 46 breakup: 53
9 makeup: 46 breakup: 48
@yifan-gu
yifan-gu / loosen2.log
Created August 29, 2014 02:56
loosen2 (5,7, 10000)
0 makeup: 37648 breakup: 6410
1 makeup: 357 breakup: 197
2 makeup: 49 breakup: 18
3 makeup: 43 breakup: 21
4 makeup: 37 breakup: 32
5 makeup: 0 breakup: 0
6 makeup: 0 breakup: 0
7 makeup: 0 breakup: 0