Skip to content

Instantly share code, notes, and snippets.

View Rexicon226's full-sized avatar
💭
optimizing

David Rubin Rexicon226

💭
optimizing
View GitHub Profile
import matplotlib.pyplot as plt
import matplotlib.ticker as tkr
import pandas as pd
def sizeof_fmt(x, pos):
if x<0:
return ""
for x_unit in ['bytes', 'kB', 'MB', 'GB', 'TB']:
if x < 1024:
return "%3.0f %s" % (x, x_unit)
@Rexicon226
Rexicon226 / update.py
Last active February 25, 2025 00:21
Zig RISC-V Test Updater
#!/usr/bin/env python3
import argparse
import tempfile
import subprocess
import os
import sys
from multiprocessing import Pool
SKIP_LINE = 'if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;'
COMMENT = ' // generated by update.py'
@Rexicon226
Rexicon226 / benchmark.zig
Last active June 17, 2024 14:01
optimized memeql benchmark
// zig build-exe benchmark.zig -OReleaseFast -lc
// ./benchmark 4096
const std = @import("std");
const allocator = std.heap.c_allocator;
const iterations_per_byte = 1000;
const warmup_iterations = 10;
comptime {