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
@davecheney
davecheney / gist:6740651
Last active December 24, 2015 03:59
gccgo on armv7
localhost(~/src) % gccgo -v
Using built-in specs.
COLLECT_GCC=gccgo
COLLECT_LTO_WRAPPER=/opt/libexec/gcc/arm-linux-gnueabihf/4.8.2/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../gccgo/configure --prefix=/opt --enable-languages=c,c++,go --with-ld=/usr/bin/ld --enable-shared --without-included-gettext --enable-threads=posix --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --with-system-zlib --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.8.2 20130927 (prerelease) (GCC)
localhost(~/src) % go run -compiler gccgo helloworld.go
Hello gccgo
@davecheney
davecheney / gist:6679191
Created September 24, 2013 01:20
go1.1 vs go tip http benchmarks
/home/dfc/devel/autobench/work/go.11/misc/benchcmp /home/dfc/devel/autobench/work/http-11.txt /home/dfc/devel/autobench/work/http-tip.txt
benchmark old ns/op new ns/op delta
BenchmarkHeaderWriteSubset 1455 1119 -23.09%
BenchmarkReadRequestChrome 7697 6959 -9.59%
BenchmarkReadRequestCurl 4065 3573 -12.10%
BenchmarkReadRequestApachebench 4017 3555 -11.50%
BenchmarkReadRequestSiege 5321 4675 -12.14%
BenchmarkReadRequestWrk 2698 2651 -1.74%
BenchmarkClientServer 58534 57838 -1.19%
BenchmarkClientServerParallel4 54188 55070 +1.63%
@davecheney
davecheney / stress.bash
Created September 11, 2013 10:53
stress.bash
#!/bin/bash
set -e
go test -c # -race
PKG=$(basename $(pwd))
while true ; do
export GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]]
GOTRACEBACK=2 ./$PKG.test $@ 2>&1
done
@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;
}
package main
import (
"flag"
"io"
"log"
"net"
"os"
"strings"
"time"
@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
@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
}
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%
* /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.
package main
import (
"fmt"
"io"
"net/http"
"os"
"os/signal"
"runtime/pprof"
"strconv"