Skip to content

Instantly share code, notes, and snippets.

View davecheney's full-sized avatar
🤔
i have concepts of a plan

Dave Cheney davecheney

🤔
i have concepts of a plan
View GitHub Profile
dfc@qnap:~/go/test/bench/go1$ ~/go/misc/benchcmp {old,new}.txt
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17 2147483647 2147483647 -0.90%
BenchmarkFannkuch11 2147483647 2147483647 -0.09%
BenchmarkGobDecode 181214200 179469200 -0.96%
BenchmarkGobEncode 73388200 72136100 -1.71%
BenchmarkGzip 2147483647 2147483647 +0.97%
BenchmarkGunzip 914986600 914847400 -0.02%
BenchmarkJSONEncode 878786200 870880200 -0.90%
BenchmarkJSONDecode 1999041000 2001263000 +0.11%
@davecheney
davecheney / gist:4181046
Created December 1, 2012 08:04
golang freebsd/arm on the raspberry pi
# uname -a
FreeBSD raspberry-pi 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r243694M: Thu Nov 29 19:52:08 PST 2012 root@bsdbox:/src/FreeBSD/obj/arm.armv6/src/FreeBSD/head/sys/RPI-B arm
# ~/go/pkg/tool/freebsd_arm/go_bootstrap run ~/src/hellofreebsd.go
Hello, 世界
lucky(~/src) % go run panic.go
throw: all goroutines are asleep - deadlock!
Go runtime version: devel +a32219a715c5 Wed Dec 05 15:26:18 2012 +1100 linux/amd64
goroutine 1 [select (no cases)]:
main.main()
/home/dfc/src/panic.go:3 +0x18
goroutine 2 [syscall]:
created by runtime.main
package main
import (
"fmt"
"io"
"net/http"
"os"
"os/signal"
"runtime/pprof"
"strconv"
* /exp/types/staging: expression and statement type checking.
* 5a, 5l, math: Add support for ABSD, ABSF floating point instructions (thanks Michał Derkacz).
* 5a, 5l: add PLD (preload data) instruction (thanks Shenghou Ma).
* 5a, 6a, 8a: take GOROOT_FINAL into consideration (thanks Shenghou Ma).
* 5c, 6c, 8c: take GOROOT_FINAL into consideration (thanks Shenghou Ma).
* 5l, runtime: remove softfloat emulation code when not used (thanks Shenghou Ma).
* 5l: trivial whitespace cleanup (thanks Robert Hencke).
* 6a, 6l: add PREFETCH instructions.
* 6c, 6g, 6l: add MOVQL to make truncation explicit.
* 6g: delete unnecessary OXXX initialization.
bytes: improved bytes.Equal for arm
Backport https://codereview.appspot.com/8056043/ to arm.
Work in progress
test/bench/go1:
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17 2147483647 2147483647 -6.77%
@davecheney
davecheney / stress.bash
Created June 18, 2013 23:22
usage: cd $PACKAGE; bash stress.bash
#!/bin/bash
set -e
eval $(go env)
export GOROOT
pkgs() {
go list std | grep -v cmd
}
@davecheney
davecheney / gist:5847237
Created June 24, 2013 01:35
-fsanitise=undefined
lib9
libbio
libmach
misc/pprof
cmd/addr2line
cmd/nm
cmd/objdump
cmd/pack
cmd/prof
cmd/cc
package main
import (
"flag"
"io"
"log"
"net"
"os"
"strings"
"time"
@davecheney
davecheney / gist:6402283
Created September 1, 2013 04:08
Experimenting with high frequency PWM output from an Atmel328P.
// the setup routine runs once when you press reset:
void setup() {
pinMode(3, OUTPUT);
pinMode(11, OUTPUT);
TCCR2Af = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
TCCR2B = _BV(WGM22) | _BV(CS20);
OCR2A = 1;
OCR2B = 254;
}