Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Lilo 0.2.2 – a Rust/egui Markdown notes app with widget and workspace modes(github.com/hellterenjoy ↗)
    discuss
  2. Court shines a further light on who was at fault in SVB implosion(ft.com ↗)
    discuss
  3. The Lamentable Later Life of Lemmings(filfre.net ↗)
    discuss
  4. Jev VC – Pitch Jev Your Startup(pitchjev.vercel.app ↗)
    1comments
  5. US Treasuries Have Become Unappetizing for Foreign Central Banks and Governments(wolfstreet.com ↗)
    discuss
  6. A systemd timer to log and lock kids out of their Linux accounts overnight(github.com/mowglixx ↗)
    discuss
  7. Knot: A CLI ticket tracker for solo developers(github.com/unisoma ↗)
    discuss
  8. How to run offline, local coding agents on Linux(ostechnix.com ↗)
    discuss
  9. From 2027 you must be at least 18 to use Dropbox(dropbox.com ↗)
    1comments
  10. Salesforce tracing without debug logs: every trigger, field write, and rollback(fidelic.dev ↗)
    discuss
  11. Awesome-tunneling – List of ngrok, Cloudflare Tunnel, Tailscale and related(github.com/anderspitman ↗)
    discuss
  12. Black Holes or Black Hole Stars? Astronomers Spar over 'Little Red Dots'(quantamagazine.org ↗)
    discuss
  13. System Design Unboxed: new eBook and extras(lextrem.com ↗)
    discuss
  14. Terrasat – Get Answers from Anywhere on Earth(terrasat.net ↗)
    1comments
  15. The Physics of Database Speed: from 300 to 1M transactions per second [video](youtube.com ↗)
    discuss
  16. How to Build a Scraping Tool(flaviocopes.com ↗)
    discuss
  17. Inexpressible States: The History and Usage of Algebraic Data Types(makonea.com ↗)
    discuss
  18. FlashAttention: Part 2(chizkidd.github.io ↗)
    discuss
  19. Fable 5.1 vs. Astra for coding: Fable 2X more expensive per task but solves more(imec-int.com ↗)
    2comments
  20. Extracting Grid Information Using CSS(master.dev ↗)
    discuss
  21. Lunch with the FT: Raspberry Pi Founder Eben Upton(ft.com ↗)
    discuss
  22. GPUs: Rent vs. Buy(cloud-gpus.com ↗)
    discuss
  23. Open Peeps – A hand-drawn illustration library(openpeeps.com ↗)
    discuss
  24. Grandmasters: Official Theatrical Trailer [video](youtube.com ↗)
    discuss
  25. Wafer-Scale Superconducting Transistors Cut Cryo Cables(ieee.org ↗)
    discuss
  26. Show HN: Forcefield: A fast, lightweight local-first AI agent harness(github.com/fabledruns ↗)
    discuss
  27. Stepshell – an authenticated web terminal for Kubernetes pods(github.com/aortmann ↗)
    discuss
  28. Orca – deterministic, AI-driven development flows(github.com/virtuslab ↗)
    discuss
  29. A SQL Where Clause for Taste(query.farm ↗)
    discuss
  30. Meetings [pdf](nber.org ↗)
    discuss

World's fastest compression library just doubled its speed

2 pointsby 2h agogithub.com
1 comments
2h agoHN ↗

I recently created the world's fastest compression library in C, and now I just almost doubled its speed by making it branchless.

The pseudocode shows how I advance the destination pointer with simple arithmetic, and how I select what to write there with a conditional move (that hopefully turns into a cmov instruction):

Before:

    if (hash == ((uint64_t*)src)[i]) {
     flags |= 1; \
     *(uint16_t*)dst = (uint16_t)hash;
     dst += 2;
    } else {
     hashtable[hash] = ((uint64_t*)src)[i];
     *(uint64_t*)dst = ((uint64_t*)src)[i];
     dst += sizeof(uint64_t);
    }

After:

    uint64_t val = *(uint64_t*)(src + idx * sizeof(uint64_t));
    uint64_t hit = (hash == val); // Turns 0 or 1
    flags |= (hit << shift);
    ...
    *(uint64_t*)dst = hit ? hash : val;
    hashtable[hash] = val;
    dst += sizeof(uint64_t) - (hit \* (sizeof(uint64_t) - 2));