proomt

Search

Search posts, papers, and topics

All posts

CodeName OneShai Almog8 min readadvanced

Faster Maps: Chasing Swiss Speed

Summary

ParparVM’s HashMap suffered catastrophic miss latency due to linear probing on dense integer keys. By adopting CPython‑style perturbed probing (Swiss‑table style) and extending tagged immediate values to more primitives, miss latency dropped from 32 s to ~45 ms, allocation pressure fell dramatically, and overall performance stayed roughly flat despite a modest hit‑time slowdown.

  • Linear probing on dense key ranges can cause thousands of probes for a missing key; probe sequence matters as much as hash quality.
  • Adopting CPython’s perturbed probing (Swiss‑table style) reduces miss probes to ~1‑2 while keeping first‑slot lookup fast.
  • Scrambling hashes aggressively fixes miss latency but harms dense‑key scans; the chosen hybrid keeps the first slot unchanged and only perturbs thereafter.
  • Extending tagged immediate representations to Short, Char, Float, Long, and Double eliminates most wrapper allocations for numeric values, cutting boxed allocations per map from 24 → 5 in a JSON‑like workload.

HashMap lookups dominate many Java workloads, especially in parsers and caches. A pathological miss can dominate latency and GC pressure. The article shows a concrete, measured redesign that eliminates that pathology and reduces allocation churn, offering a practical template for other VM or runtim…

8/10

Related reading

  1. Lies, Damn Lies and Benchmarks

    Codename One engineers dissect why benchmark numbers can be misleading, then share concrete work on GC tuning, proper weak/soft references, and a new probing sequence for their open‑addressed HashMap that cuts miss‑probe counts from >16 k to ~1.5 per lookup.

    CodeName Onecodenameone.com20 min
  2. What Go Taught Us About Java Garbage Collection

    ParparVM’s GC was tuned by lowering the allocation‑trigger floor, adding configurable thresholds, parallel marking, mutator assistance, and proper weak/soft reference handling. These changes cut RSS from 98 MB to 38 MB, reduced worst‑case GC pauses from seconds to sub‑second, and improved cache hit rates with a recency‑based eviction policy.

    CodeName Onecodenameone.com7 min
  3. 1 points

    Saving another 100TB of RAM with math (and Rust)

    Cloudflare reduced the memory footprint of its Pingora Backend Router by re‑examining the consistent‑hashing implementation in the pingora‑ketama library. By increasing the number of virtual hash points per server from the default 1 to the standard 160 (and applying weighted hashing based on disk capacity), they cut the per‑node overhead enough to reclaim >100 TB of RAM across the fleet. The post…

    Hacker News front pagecloudflare.com13 minHN478120lobste.rs33
  4. SiliconBench: Speed, Memory, and Fidelity for LLM Serving on Unified-Memory Desktops

    SiliconBench benchmarks nine Apple‑Silicon LLM serving engines on unified‑memory desktops, measuring speed, memory usage, and output fidelity across Qwen3, Qwen3.5, and Gemma‑4 models. It finds vllm‑metal doubles throughput at modest concurrency, memory budgets often fail to preserve headroom, and only three stacks satisfy all fidelity and model‑coverage requirements, with tensor‑parallel scaling…

    Hugging Face Daily Papersarxiv.org1 minpaper
  5. Vectorized and performance-portable Quicksort (2022)

    Google’s Highway library now includes a fully portable SIMD‑vectorized quicksort that runs 9‑19× faster than C++ std::sort. By using compress‑store (or permute‑based emulation) for partitioning, the same C++ code targets AVX2, AVX‑512, NEON, SVE and RISC‑V V. Benchmarks show 0.5 GB/s on an Apple M1 and >1 GB/s on a 3 GHz Skylake, beating prior architecture‑specific sorts. The implementation and a…

    Hacker News front pagegoogleblog.com3 minHN460142