Skip to content

Instantly share code, notes, and snippets.

View deckarep's full-sized avatar
🎯
Focusing

Ralph Caraveo deckarep

🎯
Focusing
View GitHub Profile
@deckarep
deckarep / index.html
Created November 18, 2017 00:15 — forked from kirjavascript/index.html
d3 webGL force graph with PIXI.js
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>d3 webGL force graph with PIXI.js</title>
<meta name="description" content="">
<meta name="theme-color" content="#000000">
</head>
<body>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default"></script>
@deckarep
deckarep / Go pre-commit
Created September 7, 2016 22:32 — forked from mboersma/Go pre-commit
Go project pre-commit hook
#!/bin/sh
# Save this file as ".git/hooks/pre-commit" in your
# git repository and set it to executable.
#
# To use the "go vet" command:
# $ go get -v code.google.com/p/go.tools/cmd/vet
# To use the "golint" command:
# $ go get -v github.com/golang/lint/golint
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
#! /bin/sh
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
#!/bin/sh
# Welcome to the thoughtbot laptop script!
# Be prepared to turn your laptop (or desktop, no haters here)
# into an awesome development machine.
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059

OSX i7-3720QM CPU @ 2.60GHz go1.2 darwin/amd64

Performance doesn't increase with GOMAXPROCS it gets worse on OSX!

GOMAXPROCS=1
./websocket_client 1 100000
Sent 400000 in 2.389414969s for a rate of 167404/second

GOMAXPROCS=2
./websocket_client 2 100000

Sent 400000 in 6.219798526s for a rate of 64310/second <-- Lost 100K msgs/second!

package main
import (
"code.google.com/p/go.net/websocket"
)
type connection struct {
// The websocket connection.
ws *websocket.Conn