Skip to content

Instantly share code, notes, and snippets.

@billhathaway
billhathaway / benchmark results.txt
Last active September 16, 2016 14:04
elvis added stream example with buffer and fixed bug in case of find pattern split across buffers
Thanks to Tyler Burnell, Bill Kennedy and others who had written all the boilerplate I copied in main.go and main_test.go
Note: the benchmark data is horribly unrealistic (10M input of either no matches or all matches), but I think the model of testing MB/sec throughput of large input sets is the right one for the problem statement. I welcome additions where we make the test data more realistic. Using a very small data set of a few hundred bytes doesn't seem like a good test
for stream processing algorithm performance.
go test -run none -bench . -benchtime 3s -benchmem
testing: warning: no tests to run
PASS
BenchmarkProcessByteUnmatched-8 30 143059391 ns/op 69.90 MB/s 1 B/op 1 allocs/op
BenchmarkProcessByteMatched-8 30 120619527 ns/op 82.91 MB/s 1 B/op 1 allocs/op
@billhathaway
billhathaway / README.md
Created September 2, 2016 13:41
passing in values during go build time
 package main

 import "fmt"
  
   var (
     version  = "develop"
     otherval = "unset"
   )
package psutil
import (
"fmt"
"log"
"strings"
"cloud.google.com/go/pubsub"
netcontext "golang.org/x/net/context"
)