Skip to content

Instantly share code, notes, and snippets.

alblue / Moved
Last active Feb 16, 2020
Demonstration of JMH and StringBuilder/StringBuffer performance - original blog at
View Moved
This project has moved to
rianhunter / call_overhead.c
Last active May 14, 2022
Indirect vs Direct Function Call Overhead in C/C++
View call_overhead.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.
steveklabnik /
Created Mar 23, 2015
a little wc-like in rust
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();
dpryden /
Created Oct 20, 2014
Example of a ClassLoader leak in Java
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,
MarcusVoelker / main.cpp
Created May 14, 2014
Short testing program to benchmark the performance of various timers on your linux system
View main.cpp
#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)
spicycode / tmux.conf
Created Sep 20, 2011
The best and greatest tmux.conf ever
View tmux.conf
# 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