Skip to content

Instantly share code, notes, and snippets.

package udp_test
import (
"net"
"strconv"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
✘ ~ → go test -v runtime/pprof
=== RUN TestMemoryProfiler
--- PASS: TestMemoryProfiler (0.01s)
=== RUN TestCPUProfile
--- PASS: TestCPUProfile (5.00s)
pprof_test.go:139: uname -a: Darwin liszt.local 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64
pprof_test.go:216: total 440 CPU profile samples collected
pprof_test.go:239: runtime/pprof_test.cpuHog1: 406
=== RUN TestCPUProfileMultithreaded
--- PASS: TestCPUProfileMultithreaded (5.00s)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int sink;
void doSomething() {
package main
import (
"net"
_ "net/http/pprof"
)
const host = "localhost:4242"
// Opens a UDP listener and ignores any data
package main
import (
"net"
"net/http"
_ "net/http/pprof"
)
const host = "localhost:4242"
Contributor License Agreement
The following terms are used throughout this agreement:
You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
Project - is an umbrella term that refers to any and all GitHub open source projects.
Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with GitHub, contributors or maintainers.
1. Grant of Copyright License.
package bench
import (
"bytes"
"encoding/binary"
"io"
"testing"
)
func BenchmarkWriteByte(b *testing.B) {
server {
listen 443;
server_name example.com;
client_max_body_size 0;
chunkin on;
ssl on;
ssl_certificate /path/to/crt;
ssl_certificate_key /path/to/key;
@lucas-clemente
lucas-clemente / Tomorrow.tmTheme
Created October 2, 2012 12:12
Tomorrow theme + SublimeLinter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>http://chriskempson.com</string>
<key>name</key>
<string>Tomorrow</string>
<key>settings</key>
<array><dict><key>name</key><string>mon_color</string><key>scope</key><string>mcol_ff0000FF</string><key>settings</key><dict><key>background</key><string>#ff0000FF</string><key>caret</key><string>#FFFFFFFF</string><key>foreground</key><string>#FFFFFFFF</string></dict></dict>
@lucas-clemente
lucas-clemente / latex.py
Created October 2, 2012 11:51
LaTeX linter for SublimeLint
# -*- coding: utf-8 -*-
# ruby.py - sublimelint package for checking latex files
import re
from base_linter import BaseLinter
CONFIG = {
'language': 'LaTeX',
'executable': 'chktex',