Skip to content

Instantly share code, notes, and snippets.

💭
I am working on Go stuff

David Chase dr2chase

💭
I am working on Go stuff
Block or report user

Report or block dr2chase

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dr2chase
dr2chase / gogollvm3.log
Created Jul 9, 2019
Raw compilation and benchmark results, Go vs Gollvm -O3 (including stdlib)
View gogollvm3.log
This file has been truncated, but you can view the full file.
( GOPATH=/usr/local/google/home/drchase/work/bent/gopath GO111MODULE=auto go get -d -t -v github.com/ethereum/go-ethereum/common/bitutil )
( GOPATH=/usr/local/google/home/drchase/work/bent/gopath GO111MODULE=auto go get -d -t -v github.com/ethereum/go-ethereum/swarm/storage )
There was an error running 'go get', stderr = github.com/ethereum/go-ethereum (download)
package github.com/ethereum/go-ethereum/swarm/storage: cannot find package "github.com/ethereum/go-ethereum/swarm/storage" in any of:
/usr/local/google/home/drchase/work/go/src/github.com/ethereum/go-ethereum/swarm/storage (from $GOROOT)
/usr/local/google/home/drchase/work/bent/gopath/src/github.com/ethereum/go-ethereum/swarm/storage (from $GOPATH)
DISABLING benchmark ethereum_storage
( GOPATH=/usr/local/google/home/drchase/work/bent/gopath GO111MODULE=auto go get -d -t -v github.com/ethereum/go-ethereum/consensus/ethash )
@dr2chase
dr2chase / GolangBostonMeetup_2017_06_debugging.md
Created Jun 28, 2017
Notes from the Golang Boston Meetup 2017-06-27 debugging meeting
View GolangBostonMeetup_2017_06_debugging.md

Here are my notes from the Golang Boston Meetup 2017-06-27 debugging meeting, such as they are. Corrections/elaborations welcome.

Notes from debugging group. TLDR: fmt.Println is still very common; nobody in the room knew everything -- i.e., there's debugging tricks and techniques that you probably don't know; there's ever so much "upside potential" in the current tools.

Techniques mentioned:

  • fmt.Println
View Evaluation of loop rotation in layout phase.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dr2chase
dr2chase / ex3.bash
Created May 26, 2017
Sample script for running experiment.bash on several branches
View ex3.bash
#!/bin/bash
git change master
variant=master_2017_05_24 bash -x ./experiment.bash
echo
git change rotate_in_layout
variant=rotate_in_layout bash -x ./experiment.bash
echo
@dr2chase
dr2chase / experiment.bash
Last active May 26, 2017
Script for running a number of benchmarks comparing performance of GOEXPERIMENT=preemptibleloops
View experiment.bash
#!/bin/bash
# Run with environment variable "variant" set to some useful string legal in a file name.
N=25
if [[ `arch` == "ppc64le" ]] ; then
dohttp=
else
dohttp=1
done
View bench2ss
#!/bin/bash
# filter output of multiple benchmarking experiments into a spreadsheet-friendly form
egrep '^[[a-zA-Z/]' "$1" | egrep -v "B/s|old speed" | \
sed -e '1,$s/[^0-9]*s ±[ 0-9]*%//g' | sed -e '1,$s/(p.*)//g' | \
sed -e '1,$s?[-_.a-z/]*git-codereview: changed to branch ?,?g' | \
sed -e '1,$s/ * /,/g' | \
sed -e '1,$s/,~//g' | \
sed -e '1,$s/,[-+][0-9.]*%//g' | \
@dr2chase
dr2chase / javabugdemo.bash
Created May 15, 2017
Shell script that unpacks and runs a Java bug. Verification does not ensure static correctness of interface types.
View javabugdemo.bash
echo "interface I1 { }" > I1.java
echo "interface I2 { }" > I2.java
echo "interface I3 { }" > I3.java
echo "class I1I2 implements I1, I2 { }" > I1I2.java_good
echo "class I1I2 implements I1 { }" > I1I2.java_bad
echo "class I1I3I2 implements I1, I3, I2 { }" > I1I3I2.java
cat > tricky.java <<'//EOF'
class tricky {
I2 i2;
@dr2chase
dr2chase / 18597-args-results-in-registers.md
Last active Oct 5, 2017
Browsable copy of golang proposal CL 35054
View 18597-args-results-in-registers.md

Proposal: Passing Go arguments and results in registers.

Author(s): David Chase

Last updated: 2017-01-10

Discussion at https://golang.org/issue/18597.

Abstract

View duffsteptest_bug_updated.txt
~/GoogleDrive/work/tmp/ttmp$ dlv debug
Type 'help' for list of commands.
(dlv) b main.foo
Breakpoint 1 set at 0x2058 for main.foo() ./step_hide.go:12
(dlv) c
> main.foo() ./step_hide.go:12 (hits goroutine(11):1 total:3) (PC: 0x2058)
> main.foo() ./step_hide.go:12 (hits goroutine(7):1 total:3) (PC: 0x2058)
> main.foo() ./step_hide.go:12 (hits goroutine(5):1 total:3) (PC: 0x2058)
7:
8: var v int = 99
View dlv_step_goroutine_change.log
dlv debug
Type 'help' for list of commands.
(dlv) b step_hide.go:35
Breakpoint 1 set at 0x237c for main.main() ./step_hide.go:35
(dlv) c
> main.main() ./step_hide.go:35 (hits goroutine(1):1 total:1) (PC: 0x237c)
30: x := v
31: y := x * x
32: var z int
33: threads()
You can’t perform that action at this time.