Skip to content

Instantly share code, notes, and snippets.

@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@MarcusVoelker
MarcusVoelker / main.cpp
Created May 14, 2014 15:28
Short testing program to benchmark the performance of various timers on your linux system
#include <iostream>
const unsigned long long SEC = 1000L*1000L*1000L;
inline unsigned long long timespecTo64( const timespec &_time ) {
return ( _time.tv_sec*SEC + _time.tv_nsec );
}
void runTest(clockid_t clkid, std::string const& name)
{
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@steveklabnik
steveklabnik / wc.rs
Created March 23, 2015 21:50
a little wc-like in rust
#![feature(collections)]
use std::io::prelude::*;
use std::fs::File;
use std::io::BufReader;
fn main() {
let args: Vec<String> = std::env::args().collect();
let filename = args[1].clone();
@rianhunter
rianhunter / call_overhead.c
Last active December 21, 2023 23:25
Indirect vs Direct Function Call Overhead in C/C++
/*
This benchmark shows how indirect function calls have nearly
the same overhead costs as direct function calls.
This is comparing apples to apples, factoring out the savings
due to inlining optimizations that direct calls usually afford.
From this, it seems that inlining and other generic interprocedual
optimizations are the main drivers of direct function call optimization,
not the direct call itself.
@alblue
alblue / Moved
Last active February 16, 2020 20:35
Demonstration of JMH and StringBuilder/StringBuffer performance - original blog at http://alblue.bandlem.com/2016/04/jmh-stringbuffer-stringbuilder.html
This project has moved to https://github.com/alblue/com.bandlem.jmh.microopts