Skip to content

Instantly share code, notes, and snippets.

View mjgp2's full-sized avatar

Matthew Painter mjgp2

View GitHub Profile
@mjgp2
mjgp2 / compare.sh
Last active June 17, 2024 13:35
Compare two different docker images a and b
#!/bin/bash
IMAGE_A=$1
IMAGE_B=$2
TMP_DIR=$(mktemp -d)
cleanup() {
rm -rf "$TMP_DIR"
}
# Trap signals
@mjgp2
mjgp2 / FsyncBenchmark.java
Created February 5, 2025 10:19
Benchmarking different durability options in Java like fsync, channel.force, direct JNA calls, ...
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.lang.reflect.Field;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.file.FileSystems;