Skip to content

Instantly share code, notes, and snippets.

View derekcollison's full-sized avatar

Derek Collison derekcollison

View GitHub Profile
Verifying myself: My Bitcoin username is +derekcollison. https://onename.io/derekcollison
@derekcollison
derekcollison / keybase.md
Last active August 29, 2015 14:17
keybase.io

Keybase proof

I hereby claim:

  • I am derekcollison on github.
  • I am derekcollison (https://keybase.io/derekcollison) on keybase.
  • I have a public key whose fingerprint is E20F 8432 C2ED 2407 82BC 7BCE 0688 7D71 4F24 9E24

To claim this, I am signing this object:

benchmark old ns/op new ns/op delta
Benchmark___PubNo_Payload 205 203 -0.98%
Benchmark___Pub8b_Payload 256 205 -19.92%
Benchmark__Pub32b_Payload 339 232 -31.56%
Benchmark_Pub256B_Payload 1082 319 -70.52%
Benchmark___Pub1K_Payload 4026 846 -78.99%
Benchmark___Pub4K_Payload 16623 5978 -64.04%
Benchmark___Pub8K_Payload 38252 19850 -48.11%
Benchmark__________PubSub 476 433 -9.03%
Benchmark__PubSubTwoConns 431 428 -0.70%
~/Development/go/src/github.com/nats-io/gnatsd/test> GOMAXPROCS=3 go test -run="-" -bench="."
PASS
Benchmark___PubNo_Payload-3 10000000 194 ns/op 56.48 MB/s
Benchmark___Pub8b_Payload-3 10000000 186 ns/op 101.77 MB/s
Benchmark__Pub32b_Payload-3 10000000 208 ns/op 210.76 MB/s
Benchmark_Pub256B_Payload-3 5000000 289 ns/op 929.40 MB/s
Benchmark___Pub1K_Payload-3 2000000 630 ns/op 1645.63 MB/s
Benchmark___Pub4K_Payload-3 500000 3255 ns/op 1262.32 MB/s
Benchmark___Pub8K_Payload-3 200000 6903 ns/op 1188.59 MB/s
Benchmark__________PubSub-3 3000000 408 ns/op
@derekcollison
derekcollison / gist:1079547
Created July 13, 2011 01:15
Utilizing crash instance ids for the `vmc files` command
~/Development/vcap/apps/crash_foo> vmc push foo
Would you like to deploy from the current directory? [Yn]:
Application Deployed URL: 'foo.cloudfoundry.com'?
Detected a Sinatra Application, is this correct? [Yn]:
Memory Reservation [Default:128M] (64M, 128M, 256M, 512M, 1G or 2G)
Creating Application: OK
Would you like to bind any services to 'foo'? [yN]:
Uploading Application:
Checking for available resources: OK
#!/usr/bin/tclsh8.5
#
# Usage: unmerged branch1 branch2
proc getlog branch {
lrange [split [exec git log $branch --oneline] "\n"] 0 100
}
proc diff {title c1 c2} {
puts "\n$title"
@derekcollison
derekcollison / vmc_token
Created March 23, 2012 21:02
Some fun history executing `more .vmc_token`
{
"http://api.cloudfoundry.qa.mozycloud.com/":"token-xxx",
"http://api.staging-cloudfoundry.com":"token-xxx",
"https://api.cloudfoundry.com":"token-xxx",
"http://api.derek.cloudfoundry.me":"token-xxx",
"http://api.vcloudlabs.com":"token-xxx",
"http://api.appcloud07.dev.mozycloud.com":"token-xxx",
"http://api.cloudfoundry.com":"token-xxx",
"http://cc.alpha.vmforce.com":"token-xxx",
"https://api.vcloudlabs.com":"token-xxx",
@derekcollison
derekcollison / GoHash
Created October 29, 2012 22:32
Fast Hash Algorithms in Go
I have done some more work on creating very fast hash algorithms in Go for small (3-8) and medium (16-32) size keys. Below are the current results.
NOTE: I used SetBytes(1) to give quick estimate of ops/sec
2012 MacbookAir 11" i7 2Ghz
================
OSX - Mountain Lion
Go version go1.0.3
================
telnet demo.nats.io 4222
Connected to demo.nats.io.
Escape character is '^]'.
INFO {"server_id":"ad29ea9cbb16f2865c177bbd4db446ca","version":"0.6.8","go":"go1.5.1","host":"0.0.0.0","port":4222,"auth_required":false,"ssl_required":false,"max_payload":1048576}
SUB foo 1
+OK
PUB foo 6
hello!
+OK
MSG foo 1 6
@derekcollison
derekcollison / gist:5685672
Last active December 17, 2015 22:59
Go 1.1 Map performance.
Impressed with the performance gains in go 1.1 on maps. I had to write my own for the original gnatsd.
HashMap is my own implementation.
go 1.0.3
~/Development/go/src/github.com/apcera/gnatsd/hashmap> go test --bench="."
PASS
Benchmark_GoMap___GetSmallKey 50000000 53.1 ns/op 18.82 MB/s
Benchmark_HashMap_GetSmallKey 10000000 21.4 ns/op 46.69 MB/s
Benchmark_GoMap____GetMedKey 20000000 107 ns/op 9.27 MB/s
Benchmark_HashMap__GetMedKey 50000000 34.7 ns/op 28.78 MB/s