Skip to content

Instantly share code, notes, and snippets.

package foo;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ConcurrentHashMap;
package net.tdowns;
import java.util.Arrays;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
package whatever;
import java.util.function.Supplier;
import org.apache.commons.lang3.concurrent.ConcurrentException;
import org.apache.commons.lang3.concurrent.LazyInitializer;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.CompilerControl.Mode;
import org.openjdk.jmh.annotations.Level;
; compile this like:
; nasm -f elf64 decode-test.s
default rel
BITS 64
GLOBAL _start
_start:
; iteration count, doesn't really matter much for the purposes of this test
mov rsi, 1_000_000
; compile this like:
; nasm -f elf64 decode-test.s
default rel
BITS 64
GLOBAL _start
_start:
; iteration count, doesn't really matter much for the purposes of this test
mov rsi, 1_000_000
/* https://stackoverflow.com/questions/20697215/when-should-we-use-prefetch */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/timeb.h>
#include <emmintrin.h>
#define MIB (1024 * 1024)
#define ELEM int
// file Base.java
public class Base {
final void print() { System.out.println("base"); };
}
// file Derived.java
public class Derived extends Base {
@Override
void print() {
System.out.println("derived");
@travisdowns
travisdowns / dry.sh
Last active November 27, 2018 22:51
setup EC2 for development
git clone https://github.com/Keith-S-Thompson/dhrystone
cd dhrystone/v2.2
CFLAGS=-O3 sh dry.c
./dry2
#!/bin/bash
sudo apt update
sudo apt-get install -y build-essential unzip
git clone https://github.com/inikep/lzbench
cd lzbench
curl http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip > silesia.zip
#!/bin/bash
LINUX=linux-4.19.5
set -e
set -x
if [ -z "$THREADS" ]; then
echo "set THREADS to the number of compilation threads"
exit 1