View macos_pprof_bias.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"compress/gzip" | |
"io" | |
"os" | |
"testing" | |
) |
View _commands.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl 'http://169.254.169.254/latest/meta-data/instance-type' | |
c6g.metal | |
$ go version | |
go version go1.19.3 linux/arm64 | |
$ go test -run='^$' -cpu=1,2,4,8,16,32,64 -bench . -count=30 -timeout=0 | tee bench.txt | |
$ benchstat bench.txt | tee benchstat.txt |
View test.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go | |
index 1947edf44a..f474036ccf 100644 | |
--- a/src/runtime/pprof/pprof_test.go | |
+++ b/src/runtime/pprof/pprof_test.go | |
@@ -1435,49 +1435,25 @@ func TestLabelSystemstack(t *testing.T) { | |
// Two conditions to check: | |
// * labelHog should always be labeled. | |
// * The label should _only_ appear on labelHog and the Do call above. | |
- for _, s := range p.Sample { | |
+ _true, _false := true, false |
View json0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":0,"package":"main","goos":"darwin","goarch":"amd64","gc_version":"go1.17.2","file":"/Users/felix.geisendoerfer/go/src/github.com/felixge/dump/inline-test/main.go"} | |
{"range":{"start":{"line":5,"character":6},"end":{"line":5,"character":6}},"severity":3,"code":"canInlineFunction","source":"go compiler","message":"cost: 59"} | |
{"range":{"start":{"line":9,"character":6},"end":{"line":9,"character":6}},"severity":3,"code":"cannotInlineFunction","source":"go compiler","message":"function too complex: cost 88 exceeds budget 80"} | |
{"range":{"start":{"line":11,"character":15},"end":{"line":11,"character":15}},"severity":3,"code":"escape","source":"go compiler","message":"\"Hello World\" escapes to heap","relatedInformation":[{"location":{"uri":"file:///Users/felix.geisendoerfer/go/src/github.com/felixge/dump/inline-test/main.go","range":{"start":{"line":11,"character":15},"end":{"line":11,"character":15}}},"message":"escflow: flow: ~arg0 = \u0026{storage for \"Hello World\"}:"},{"location":{"uri":"file:///U |
View example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"flameExplain": "Go to flame-explain.com and paste this JSON in the Input tab.", | |
"input": { | |
"plan": "[\n {\n \"Plan\": {\n \"Node Type\": \"Function Scan\",\n \"Parallel Aware\": false,\n \"Function Name\": \"generate_series\",\n \"Schema\": \"pg_catalog\",\n \"Alias\": \"generate_series\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 10.00,\n \"Plan Rows\": 1000,\n \"Plan Width\": 4,\n \"Actual Startup Time\": 194.503,\n \"Actual Total Time\": 331.185,\n \"Actual Rows\": 1500000,\n \"Actual Loops\": 1,\n \"Output\": [\"generate_series\"],\n \"Function Call\": \"generate_series(1, 1500000)\",\n \"Shared Hit Blocks\": 0,\n \"Shared Read Blocks\": 0,\n \"Shared Dirtied Blocks\": 0,\n \"Shared Written Blocks\": 0,\n \"Local Hit Blocks\": 0,\n \"Local Read Blocks\": 0,\n \"Local Dirtied Blocks\": 0,\n \"Local Written Blocks\": 0,\n \"Temp Read Blocks\": 0,\n \"Temp Written Bloc |
View example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"flameExplain": "Go to flame-explain.com and paste this JSON in the Input tab.", | |
"input": { | |
"plan": "[\n {\n \"Plan\": {\n \"Node Type\": \"Function Scan\",\n \"Parallel Aware\": false,\n \"Function Name\": \"generate_series\",\n \"Schema\": \"pg_catalog\",\n \"Alias\": \"generate_series\",\n \"Startup Cost\": 0.00,\n \"Total Cost\": 10.00,\n \"Plan Rows\": 1000,\n \"Plan Width\": 4,\n \"Actual Startup Time\": 194.503,\n \"Actual Total Time\": 331.185,\n \"Actual Rows\": 1500000,\n \"Actual Loops\": 1,\n \"Output\": [\"generate_series\"],\n \"Function Call\": \"generate_series(1, 1500000)\",\n \"Shared Hit Blocks\": 0,\n \"Shared Read Blocks\": 0,\n \"Shared Dirtied Blocks\": 0,\n \"Shared Written Blocks\": 0,\n \"Local Hit Blocks\": 0,\n \"Local Read Blocks\": 0,\n \"Local Dirtied Blocks\": 0,\n \"Local Written Blocks\": 0,\n \"Temp Read Blocks\": 0,\n \"Temp Written Bloc |
View main-linux.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example program showing that signal delivery from setitimer ends up in | |
// "random" threads of the executing program. | |
#include <sys/time.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
View multiwrap.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package multiwrap implements support for wrapping multiple errors into a | |
// single error value that supports the Go 1.13 Unwrap(), Is() and As() | |
// interface. It's similar to go-multierror [1]. | |
// | |
// This is a proof of concept and I'm looking for feedback! Maybe somebody has | |
// already done a nicer version of this idea? | |
// | |
// [1] https://godoc.org/github.com/hashicorp/go-multierror | |
package multiwrap |
View wc.asm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global main | |
extern printf | |
section .text | |
main: | |
sub rdi, 1 ; argc includes program name, so substract 1 to get arg count | |
cmp rdi, 1 ; check if we got exactly 1 arg | |
jne bad_arg_count ; if not, jump to bad_arg_count | |
mov r15, [rsi+8] ; main's argv[1] | |
mov r14, 0 ; index (also byte count) |
View blocked-by-loop.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let last = new Date(); | |
setInterval(function () { | |
delta = new Date() - last; | |
if (delta > 2) { | |
console.log(delta); | |
} | |
last = new Date(); | |
}, 1); | |
setInterval(function () { |
NewerOlder