Skip to content

Instantly share code, notes, and snippets.

View barddoo's full-sized avatar

Charles Fonseca barddoo

View GitHub Profile
@barddoo
barddoo / simd_optimization_benchmark
Last active October 13, 2025 13:51
SIMD String Equality Optimization Benchmark
╔════════════════════════════════════════════════════════════════╗
║ Results ║
╚════════════════════════════════════════════════════════════════╝
┌─ Very Short (2-4 bytes) ────────────────────────────────────┐
│ Implementation │ Ops/sec │ ns/cmp │ vs baseline │
├───────────────────────────┼────────────┼────────┼─────────────┤
│ 🏆 SIMD Opt1 (comptime) │ 893694982 │ 1.12 │ 1.00x │
│ SIMD Opt4 (xor) │ 862645302 │ 1.16 │ 0.97x │
│ SIMD Opt2 (unrolled) │ 861406870 │ 1.16 │ 0.96x │
@barddoo
barddoo / hash_benchmark.zig
Created October 13, 2025 13:31
Hash Function Benchmark for Zedis
const std = @import("std");
// Import all hash functions we want to test
const Wyhash = std.hash.Wyhash;
const CityHash64 = std.hash.CityHash64;
const Murmur3_32 = std.hash.Murmur3_32;
/// FNV-1a implementation
fn fnv1aHash(s: []const u8) u32 {
if (s.len == 0) return 0;