Skip to content

Instantly share code, notes, and snippets.

@bmatsuo
bmatsuo / bench.old.txt
Last active August 29, 2015 14:10
Reader benchmarks from the master branch (9438ff5)
PASS
BenchmarkReaderManpage 1000000 20223 ns/op 126.09 MB/s
BenchmarkReaderManpage_buffered 1000000 20176 ns/op 126.39 MB/s
BenchmarkReaderManpageNoCopy 1000000 20179 ns/op 126.36 MB/s
BenchmarkReaderJSON 50000 320459 ns/op 76.23 MB/s
BenchmarkReaderJSON_buffered 50000 332016 ns/op 68.00 MB/s
BenchmarkReaderJSONNoCopy 50000 334736 ns/op 67.45 MB/s
BenchmarkReaderRandom 10000 1859415 ns/op 5640.66 MB/s
BenchmarkReaderRandom_buffered 10000 1837270 ns/op 5707.95 MB/s
BenchmarkReaderRandomNoCopy 10000 2782352 ns/op 3769.13 MB/s
@bmatsuo
bmatsuo / snappy-go-index.err
Created September 8, 2014 01:55
This gist demonstrates several panics in the snappy-go package resulting from passing the Decode function malformed input. The snappy-go rev is 12e4b4183793, current at the time these tests were run.
panic: runtime error: index out of range
goroutine 16 [running]:
runtime.panic(0x4b9d80, 0x546cbc)
/usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
code.google.com/p/snappy-go/snappy.Decode(0x0, 0x0, 0x0, 0x7f713339ceb5, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, ...)
/home/bryan/src/code.google.com/p/snappy-go/snappy/decode.go:49 +0xb0c
main.main()
/home/bryan/src/github.com/bmatsuo/sandbox/snappy-go-panic/snappy-go-index/main.go:11 +0x9c
@bmatsuo
bmatsuo / README.md
Last active August 29, 2015 14:04
go-snappystream benchmark comparisons for branch bmatsuo:snappy-go/optimize

Benchmarks were given two seconds to run. Allocations were recorded for each benchmark.

go test -test.benchtime=2s -test.benchmem=true -run=NONE -bench=. > [old,new].bench.txt

Benchmarks are compared with benchcmp

benchcmp old.bench.txt new.bench.txt

@bmatsuo
bmatsuo / opendbi.go
Created June 11, 2014 19:11
This results in a runtime panic "opening dbi :MDB_BAD_VALSIZE: Too big key/data, key is empty, or wrong DUPFIXED size"
package main
import (
"log"
"os"
mdb "github.com/szferi/gomdb"
)
func main() {
// The trouble with specialized map types... I need a better name.
package main
import "fmt"
type I interface {
M()
}
type IFunc func()