frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Forkrun – NUMA-aware shell parallelizer (50×–400× faster than parallel)

https://github.com/jkool702/forkrun
47•jkool702•4d ago
forkrun is the culmination of a 10-year-long journey focused on "how to make shell parallelization fast". What started as a standard "fork jobs in a loop" has turned into a lock-free, CAS-retry-loop-free, SIMD-accelerated, self-tuning, NUMA aware shell-based stream parallelization engine that is (mostly) a drop-in replacement for xargs -P and GNU parallel.

On my 14-core/28-thread i9-7940x, forkrun achieves:

* 200,000+ batch dispatches/sec (vs ~500 for GNU Parallel)

* ~95–99% CPU utilization across all 28 logical cores, even when the workload is non-existant (bash no-ops / `:`) (vs ~6% for GNU Parallel). These benchmarks are intentionally worst-case (near-zero work per task) because they measure the capability of the parallelization framework itself, not how much work an external tool can do.

* Typically 50×–400× faster on real high-frequency low-latency workloads (vs GNU Parallel)

A few of the techniques that make this possible:

* Born-local NUMA: stdin is splice()'d into a shared memfd, then pages are placed on the target NUMA node via set_mempolicy(MPOL_BIND) before any worker touches them, making the memfd NUMA-spliced. Each numa node only claims work that is already born-local on its node. Stealing from other nodes is permitted under some conditions when no local work exists.

* SIMD scanning: per-node indexers/scanners use AVX2/NEON to find line boundaries (delimiters) at speeds approaching memory bandwidth, and publish byte-offsets and line-counts into per-node lock-free rings.

* Lock-free claiming: workers claim batches with a single atomic_fetch_add — no locks, no CAS retry loops; contention is reduced to a single atomic on one cache line.

* Memory management: a background thread uses fallocate(PUNCH_HOLE) to reclaim space without breaking the logical offset system.

…and that’s just the surface. The implementation uses many additional systems-level techniques (phase-aware tail handling, adaptive batching, early-flush detection, etc.) to eliminate overhead, increase throughput and reduce latency at every stage.

In its fastest (-b) mode (fixed-size batches, minimal processing), it can exceed 1B lines/sec.

forkrun ships as a single bash file with an embedded, self-extracting C extension — no Perl, no Python, no install, full native support for parallelizing arbitrary shell functions. The binary is built in public GitHub Actions so you can trace it back to CI (see the GitHub "Blame" on the line containing the base64 embeddings). Trying it is literally two commands:

    . frun.bash    
    frun shell_func_or_cmd < inputs
For benchmarking scripts and results, see the BENCHMARKS dir in the GitHub repo

For an architecture deep-dive, see the DOCS dir in the GitHub repo

Happy to answer questions.

Comments

jkool702•4d ago
Hi HN,

Have you ever run GNU Parallel on a powerful machine just to find one core pegged at 100% while the rest sit mostly idle?

I hit that wall...so I built forkrun.

forkrun is a self-tuning, drop-in replacement for GNU Parallel (and xargs -P) designed for high-frequency, low-latency shell workloads on modern and NUMA hardware (e.g., log processing, text transforms, HPC data prep pipelines).

On my 14-core/28-thread i9-7940x it achieves:

- 200,000+ batch dispatches/sec (vs ~500 for GNU Parallel)

- ~95–99% CPU utilization across all 28 logical cores (vs ~6% for GNU Parallel)

- Typically 50×–400× faster on real high-frequency low-latency workloads (vs GNU Parallel)

These benchmarks are intentionally worst-case (near-zero work per task), where dispatch overhead dominates. This is exactly the regime where GNU Parallel and similar tools struggle — and where forkrun is designed to perform.

A few of the techniques that make this possible:

- Born-local NUMA: stdin is splice()'d into a shared memfd, then pages are placed on the target NUMA node via set_mempolicy(MPOL_BIND) before any worker touches them, making the memfd NUMA-spliced.

- SIMD scanning: per-node indexers use AVX2/NEON to find line boundaries at memory bandwidth and publish byte-offsets and line-counts into per-node lock-free rings.

- Lock-free claiming: workers claim batches with a single atomic_fetch_add — no locks, no CAS retry loops; contention is reduced to a single atomic on one cache line.

- Memory management: a background thread uses fallocate(PUNCH_HOLE) to reclaim space without breaking the logical offset system.

…and that’s just the surface. The implementation uses many additional systems-level techniques (phase-aware tail handling, adaptive batching, early-flush detection, etc.) to eliminate overhead at every stage.

In its fastest (-b) mode (fixed-size batches, minimal processing), it can exceed 1B lines/sec. In typical streaming workloads it's often 50×–400× faster than GNU Parallel.

forkrun ships as a single bash file with an embedded, self-extracting C extension — no Perl, no Python, no install, full native support for parallelizing arbitrary shell functions. The binary is built in public GitHub Actions so you can trace it back to CI (see the GitHub "Blame" on the line containing the base64 embeddings).

- Benchmarking scripts and raw results: https://github.com/jkool702/forkrun/blob/main/BENCHMARKS

- Architecture deep-dive: https://github.com/jkool702/forkrun/blob/main/DOCS

- Repo: https://github.com/jkool702/forkrun

Trying it is literally two commands:

    . frun.bash    # OR  `. <(curl https://raw.githubusercontent.com/jkool702/forkrun/main/frun.bash)`
    frun shell_func_or_cmd < inputs
Happy to answer questions.
esafak•2h ago
Please don't support only curl for installation. There are many package registries you can use; e.g., https://github.com/aquaproj/aqua-registry
brightmood•2h ago
Why the hell do you curl ? Additionally, why do you advertise it when you just had uploaded it? Nobody should install something that new...
DetroitThrow•1h ago
>Have you ever run GNU Parallel on a powerful machine just to find one core pegged at 100% while the rest sit mostly idle?

Yes, to my extreme frustration. Thank you, I'm installing this right now while I read the rest of your comment.

brightmood•1h ago
I am using a 9950x3D processor and didn't see any slow-down nor cpu sitting idle, I suggest you read the man-pages more clearly :P
wood_spirit•18m ago
Thanks for making and thanks for sharing :)

I’m not a parallels kind of user but I can appreciate your craft and know how rewarding these odysseys can be :)

What was the biggest “aha” moment when you worked how things interlock or you needed to make both change an and b at the same time, as either on their own slowed it down? Etc. And what is the single biggest impacting design choice?

And if you’re objective, what could be done to other tools to make them competitive?

nasretdinov•1h ago
Generally when I want to run something with so much parallelism I just write a small Go program instead, and let Go's runtime handle the scheduling. It works remarkably well and there's no execve() overhead too
beanjuiceII•50m ago
dang and u did all that without a 10 year journey
tombert•19m ago
I guess I've never really used parallel for anything that was bound by the dispatch speed of parallel itself. I've always use parallel for running stuff like ffmpeg in a folder of 200+ videos, and the speed in which parallel decides to queue up the jobs is going to be very thoroughly eaten by the cost of ffmpeg itself.

Still, worth a shot.

I have to ask, was this vibe-coded though? I ask because I see multiple em dashes in your description here, and a lot of no X, no Y... notation that Codex seems to be fond of.

ETA: Not vibe coded, I see stuff from four years ago...my mistake!

Claude Code's source code has been leaked via a map file in their NPM registry

https://twitter.com/Fried_rice/status/2038894956459290963
1564•treexs•10h ago•783 comments

The Claude Code Source Leak: fake tools, frustration regexes, undercover mode

https://alex000kim.com/posts/2026-03-31-claude-code-source-leak/
111•alex000kim•6h ago•51 comments

Cohere Transcribe: Speech Recognition

https://cohere.com/blog/transcribe
97•gmays•2h ago•36 comments

Open source CAD in the browser (Solvespace)

https://solvespace.com/webver.pl
207•phkahler•6h ago•65 comments

Good code will still win

https://www.greptile.com/blog/ai-slopware-future
56•dakshgupta•4h ago•111 comments

Show HN: Forkrun – NUMA-aware shell parallelizer (50×–400× faster than parallel)

https://github.com/jkool702/forkrun
48•jkool702•4d ago•9 comments

Accidentally created my first fork bomb with Claude Code

https://www.droppedasbaby.com/posts/2602-01/
25•offbyone42•11h ago•3 comments

Show HN: My open-world voxel game with a magic system, playable in the browser

https://kouh.me/wildmagic
5•kouhxp•36m ago•0 comments

From 300KB to 69KB per Token: How LLM Architectures Solve the KV Cache Problem

https://news.future-shock.ai/the-weight-of-remembering/
29•future-shock-ai•2d ago•1 comments

A Primer on Long-Duration Life Support

https://mceglowski.substack.com/p/a-primer-on-long-duration-life-support
14•zdw•4d ago•0 comments

OkCupid gave 3M dating-app photos to facial recognition firm, FTC says

https://arstechnica.com/tech-policy/2026/03/okcupid-match-pay-no-fine-for-sharing-user-photos-wit...
52•whiteboardr•1h ago•9 comments

Ollama is now powered by MLX on Apple Silicon in preview

https://ollama.com/blog/mlx
582•redundantly•15h ago•299 comments

GitHub Monaspace Case Study

https://lettermatic.com/custom/monaspace-case-study
79•homebrewer•4h ago•24 comments

Axios compromised on NPM – Malicious versions drop remote access trojan

https://www.stepsecurity.io/blog/axios-compromised-on-npm-malicious-versions-drop-remote-access-t...
1678•mtud•16h ago•664 comments

Audio tapes reveal mass rule-breaking in Milgram's obedience experiments

https://www.psypost.org/audio-tapes-reveal-mass-rule-breaking-in-milgram-s-obedience-experiments-...
162•lentoutcry•3d ago•95 comments

Combinators

https://tinyapl.rubenverg.com/docs/info/combinators
110•tosh•7h ago•32 comments

Oracle slashes 30k jobs

https://rollingout.com/2026/03/31/oracle-slashes-30000-jobs-with-a-cold-6/
688•pje•4h ago•573 comments

RubyGems Fracture Incident Report

https://rubycentral.org/news/rubygems-fracture-incident-report/
63•schneems•5h ago•23 comments

Securing Elliptic Curve Cryptocurrencies Against Quantum Vulnerabilities [pdf]

https://quantumai.google/static/site-assets/downloads/cryptocurrency-whitepaper.pdf
21•jandrewrogers•3h ago•13 comments

Scotty: A beautiful SSH task runner

https://freek.dev/3064-scotty-a-beautiful-ssh-task-runner
21•speckx•3h ago•7 comments

Microsoft: Copilot is for entertainment purposes only

https://www.microsoft.com/en-us/microsoft-copilot/for-individuals/termsofuse
270•lpcvoid•4h ago•109 comments

Show HN: PhAIL – Real-robot benchmark for AI models

https://phail.ai
7•vertix•2h ago•7 comments

Show HN: How This Graybeard Built the Fastest and Freest Postgres BM25 Search

https://github.com/timescale/pg_textsearch
3•tjgreen•2h ago•0 comments

What major works of literature were written after age of 85? 75? 65?

https://statmodeling.stat.columbia.edu/2026/03/25/what-major-works-of-literature-were-written-aft...
97•paulpauper•3d ago•62 comments

Claude Code users hitting usage limits 'way faster than expected'

https://www.theregister.com/2026/03/31/anthropic_claude_code_limits/
197•samizdis•7h ago•130 comments

Show HN: Loreline, narrative language transpiled via Haxe: C++/C#/JS/Java/Py/Lua

https://loreline.app/en/docs/technical-overview/
36•jeremyfa•3d ago•8 comments

South Polar Times

https://www.laphamsquarterly.org/roundtable/south-polar-times
7•Thevet•21h ago•0 comments

RamAIn (YC W26) Is Hiring

https://www.ycombinator.com/companies/ramain/jobs/jezgwo5-ai-ml-research-engineer
1•svee•12h ago

Universal Claude.md – cut Claude output tokens

https://github.com/drona23/claude-token-efficient
429•killme2008•17h ago•153 comments

Tell HN: Chrome says "suspicious download" when trying to download yt-dlp

237•joering2•3h ago•73 comments