yara-g · Go 1.22+

The YARA engine
that actually
scales

Pure Go. Parallel workers. Pre-scan fingerprint filtering. Neither yarac nor yara-x can do what yara-g does at 88 workers.

$ curl -sSLf https://github.com/plan10/yara-g/releases/latest/download/yara-g-linux-amd64 | sudo tee /usr/local/bin/yara-g > /dev/null && sudo chmod +x /usr/local/bin/yara-g
$ yara-g --auto-workers rules.yar /corpus/

# 7,489 MB/s on AMD EPYC 7H12, 88 workers
7,489
MB/s
Peak throughput · 88 workers
2.2×
Faster than yarac at max workers
−65%
Scan time with holloman2 pre-scan
9
Architectural optimisations

What yara-g does that the others can't

Parallel Worker Scaling

Native -p N parallelism with per-worker buffers, NUMA-aware rule replication, and auto-worker detection. Scales linearly to 32 workers. yarac and yara-x are single-threaded.

🌊

Streaming Scan API

Scan network streams, pipes, and partial data without materialising to disk. Neither yarac nor yara-x expose a streaming API. yara-g achieves 100 MB/s streaming at 1,000 rules.

🧬

holloman2 Pre-scan Filter

Jaccard-similarity fingerprint index prunes non-matching files before expensive AC scanning. Cuts total scan time by 65% on large corpora. A capability no other engine has.

💾

Compiled Rules Cache

Persist compiled rules to disk with --rules-cache. Auto-invalidated on source change. 1.4× speedup at 5,000 rules. Skip recompilation entirely across sessions.

🔧

No libyara Dependency

Self-contained Go binary. No CGO, no shared library wrangling. Deploy to containers or embedded Linux. Cross-compile with a single go build.

📦

Full Language Support

Every pattern type, modifier, condition operator. All built-in modules (pe, elf, math, hash). Custom modules via the Go API. Backward-compatible with yarac test suite.

9 optimisations. 4 phases. One engine.

P3

Lazy bytePositions Index

Built only when XOR or hex patterns fire. Eliminates 2 full file passes for the majority of non-XOR rule sets.

P4

Async Output Queue

Channel + writer goroutine replaces global mutex. Workers never block on output — serialisation is decoupled from the scan hot path.

P7

Per-Worker Buffer

4 MB pre-allocated per worker. Eliminates sync.Pool contention at 88 concurrent workers. Zero pool overhead.

P2

CombinedAC Fused Walk

LiteralAC and HexGateAC merged into one pass over file data. Halves Phase A memory bandwidth consumption.

P5

I/O Pipeline Workers

Dedicated I/O goroutines prefetch files while scan workers run. Decouples disk latency from CPU-bound scanning.

P6

Adaptive Phase 2 Threshold

Scales with GOMAXPROCS. Inner goroutine spawn suppressed unless rule set is large enough. Eliminates 7,744 goroutine spawns per file-batch.

P8

Auto-Workers NUMA Detection

Reads /sys/devices/system/node/ topology. Defaults to socket-local core count. Prevents 2× efficiency loss from over-threading.

P1

NUMA Rule Replication

Deep-copies all 4 AC tries per NUMA node. Workers use node-local memory. Eliminates cross-socket pointer chasing in the AC Walk hot path.

P9

Phase B Parallel Verification

When ≥200 patterns and file ≥1 MB, verification distributed across up to 8 goroutines. Up to 2× on files dominated by expensive Phase B patterns.

Head-to-head on AMD EPYC 7H12

7-repeat median · 96 vCPU dual-socket · Linux 6.12

Dimension yarag yarac yara-x
Max workers 88 ✓ 1 ✗ 1 ✗
Max throughput 7,489 MB/s 3,333 MB/s 1,724 MB/s
Streaming API 100 MB/s
Pre-scan filter holloman2
Regexp throughput 143 MB/s 130 MB/s
Parallel scaling Linear to 88 None None
5 wins each — but asymmetrically. yarac leads on single-core efficiency. yara-g leads on everything that scales.

YARA was built for single-threaded hardware.
It's 2026.

The original YARA engine was never designed for multi-socket servers, NUMA topology, or corpus sizes in the billions. yara-g was. Parallel worker scaling, a pre-scan filter that runs in constant time regardless of rule count, and a streaming API that neither yarac nor yara-x provide. If you're scanning anything at scale — malware repositories, forensic corpora, DFIR pipelines — yara-g is the only engine that treats your hardware as it deserves.

plan10.org · github.com/plan10/yara-g · Built by Support Intelligence