Blog

Throughput per CPU cycle on real routers

A VM number and a hardware number rarely agree. We measured both, kept the intervals, disclosed the trap that gave a wrong result, and said where we lost.

Published September 6, 2026 · 9 minutes read · Updated October 30, 2026

On this page (7)

Newest figures, 2026-10-30

On our x86_64 Linux virtual machines, with as many threads as vCPUs, Quantum carried 1.33 to 2.67 times wireguard-go's single-stream traffic where the link was not the limit, and tied it at a 2.5 Gbit/s link. wireguard-go spent 1.7 to 2.6 times Quantum's CPU per gigabit, with Quantum in whichever setting cost it less (mostly one thread), short of our 2.5-times target in 10 of 12 measurements, and Quantum lost on latency under load to kernel WireGuard. The router figures below are from 2026-09-01 and were not re-measured. Method and every loss: the Linux benchmark.

On two physical routers, moving real traffic over a real gigabit LAN, our tunnel core pushed 122 Mbit/s where the router's own kernel tunnel implementation pushed 66.8 Mbit/s — on the same sender, at less CPU per Mbit. Neither figure is the whole story on its own.

The two arms had to use different traffic generators, because no single generator runs on both sides of that comparison. So the ratio to argue with is each arm against its own no-tunnel ceiling, which is in the table below and favours us by more, not less. A four-VM run on a laptop (2026-08-31, now history; see the update below) says something faster in absolute terms and, on one axis, something less flattering. We trust the router number more, because a router is the only one of the two that a customer's traffic actually crosses.

That is the finding worth leading with, and also the reason this post has two result sections instead of one: the virtual machines and the hardware disagree about which axis matters, and papering over that disagreement would cost more credibility than either number gains.

  1. Virtual machines Laptop virtual machines

    Four VMs on one laptop; history

  2. Routers Two MikroTik routers

    Over a real gigabit LAN: our core against the router’s own kernel tunnel

  3. Micro-benchmark Encapsulate and decapsulate cost

    Our core against boringtun 0.7.1 on an Apple M3 Max

  4. Newest Linux virtual machines

    Quantum on x86_64 virtual machines, as many threads as vCPUs, against wireguard-go

Read this before the numbers

Our data-plane defaults to one thread. The comparator we ran alongside it on our virtual machines defaults to four. Left unequalised, that flag alone swung its throughput from ~789 to 1427 Mbit/s on the laptop virtual machines of 2026-08-31 — a gap in defaults, not in datapaths — and it has already produced one wrong published number here. On dedicated x86 on 2026-10-17, boringtun at its default four threads carried 1317 Mbit/s (see the update below). Every figure from the laptop virtual machines below pins both Rust cores to one thread. The Go and the kernel implementations in that chart ran at their own defaults, which use more than one — if anything that flatters them against our single thread. The as-shipped-default gap is shown separately, once, so it isn't hidden by omission either.

What was measured, and on what

Two independent environments, because a benchmark is only honest within the environment it ran in — an iperf3 number and a bandwidth-test number are not one number wearing two names, and a VM sharing a laptop's cores is not a router.

Hardware — two MikroTik routers, one gigabit LAN, 2026-09-01. RB3011UiAS (ARMv7, 2×1400 MHz) as sender, cAP ax (ARM64, 4×864 MHz) as receiver, RouterOS 7.24.1 on both. Our core ran as fv, in a RouterOS container, in userspace, against the router's own in-kernel WireGuard-protocol implementation — the only apples-to-apples comparator available on that hardware, since it is the one alternative that ships in RouterOS itself. Two generators, because none crosses implementations cleanly: dd | nc for our container run, RouterOS's own bandwidth-test for the kernel run — each carries its own no-tunnel ceiling as a control, so a reader can sanity-check the ceiling before trusting the ratio.

Laptop virtual machines — four aarch64 Debian guests under QEMU/HVF on one Apple-silicon host, 2026-08-31. Same keypairs, addresses, ports, MTU and interface bring-up across every binary under test: our core, boringtun 0.7 (Cloudflare's userspace WireGuard implementation in Rust), wireguard-go (the WireGuard-protocol reference implementation, userspace), and the Linux kernel's own WireGuard-protocol module. 15-second iperf3 runs, three samples each, both Rust cores pinned to one data-plane thread for the reason in the callout above.

task test:impls    # VMs: ours vs boringtun vs wireguard-go vs the kernel
task test:all      # VMs: single-hop, multi-hop, and the comparison

The router run isn't a task target yet — it's fv started by hand in a RouterOS container on each box, against RouterOS's built-in WireGuard-protocol server. Full topology and every raw row sits in our own docs/benchmarks/results.csv.

The number that matters: on the router

Our core carried 122 Mbit/s against the router's own kernel tunnel's 66.8 Mbit/s, at 0.53 %/Mbit against 1.10, and lost on round-trip time, 1.22 ms against 0.92 ms.

  • ForestVPN core
  • RouterOS’s own tunnel

ThroughputMbit/sWe ledHigher is better

  • ForestVPN core122
  • RouterOS’s own tunnel66.8

CPU per Mbit%/MbitWe ledLower is better

  • ForestVPN core0.53
  • RouterOS’s own tunnel1.10

Retained against its own no-tunnel ceilingpercentWe ledHigher is better

  • ForestVPN core65
  • RouterOS’s own tunnel30

Round-trip timemsWe lostLower is better

  • ForestVPN core1.22
  • RouterOS’s own tunnel0.92

Each group has its own scale.

Two MikroTik routers, 2026-09-01, over a real gigabit LAN. Same RB3011 sender in both runs; it is the CPU ceiling throughout, at 65–79% while the receiving cAP ax idles near 20%.
Show the data
GroupSeriesValueRange
ThroughputForestVPN core122 Mbit/s
ThroughputRouterOS’s own tunnel66.8 Mbit/s
CPU per MbitForestVPN core0.53 %/Mbit
CPU per MbitRouterOS’s own tunnel1.10 %/Mbit
Retained against its own no-tunnel ceilingForestVPN core65 percent
Retained against its own no-tunnel ceilingRouterOS’s own tunnel30 percent
Round-trip timeForestVPN core1.22 ms
Round-trip timeRouterOS’s own tunnel0.92 ms

Two independent framings agree, which is what makes the result believable rather than cherry-picked: absolute throughput favours our core 1.8×, and throughput retained against each generator's own uncontested ceiling favours it 2.2×. What the chart does not say: the two generators are not the same tool, which is why both no-tunnel ceilings are printed in the table below rather than one headline ratio, and both figures would move if the sender were receiving real network traffic instead of generating it locally. Unlike the laptop results below, these are single runs: the percentages in brackets are the range the CPU wandered over during that run, not a spread across repeated trials.

Every router figure, 2026-09-01
MeasureOur core (userspace)Router's own kernel tunnel
Throughput122 Mbit/s66.8 Mbit/s
CPU, sender65% (63–67)74% (70–79)
CPU, receiver18% (10–22)20% (18–21)
CPU per Mbit0.53 %/Mbit1.10 %/Mbit
RTT1.22 ms0.92 ms
Resident memory (sender / receiver)3.0 / 3.1 MBin-kernel, not separable
Generatordd | ncbandwidth-test
That generator's no-tunnel ceiling187 Mbit/s220.5 Mbit/s
Retained against its own ceiling65%30%

Laptop virtual machines: three userspace cores, one kernel, equalised threads

2026-08-31, four VMs on one laptop; history, see the update.

With the threads equalised, our core carried 1535 Mbit/s against boringtun's 1427, wireguard-go's 1228 and kernel WireGuard's 1376, at 3.5 MB peak memory and 0.94 ms p99 latency.

  • Our core, 1 thread
  • boringtun, 1 thread
  • wireguard-go, default
  • Kernel WireGuard, default

TCP throughput, n=3Mbit/s

  • Our core, 1 thread1535 1506–1554
  • boringtun, 1 thread1427 1346–1479
  • wireguard-go, default1228 1221–1239
  • Kernel WireGuard, default1376 1366–1386
TCP throughput on four VMs on one laptop, 2026-08-31: 15-second iperf3 runs, three samples each, with the range. Both Rust cores held to one thread; wireguard-go and kernel WireGuard at their defaults.
Show the data
GroupSeriesValue, Mbit/sRange
TCP throughput, n=3Our core, 1 thread15351506–1554
TCP throughput, n=3boringtun, 1 thread14271346–1479
TCP throughput, n=3wireguard-go, default12281221–1239
TCP throughput, n=3Kernel WireGuard, default13761366–1386

As shipped, unequalised

In the 2026-08-31 laptop virtual machines, our core defaults to 1 thread and ran 1535 Mbit/s; boringtun defaults to 4 threads and ran ~789 Mbit/s at that setting. Reporting only the default-vs-default number would repeat the same mistake in the flattering direction. Both numbers are real; only one of them isolates the datapath from the thread count.

  • Our core, 1 thread
  • boringtun, 1 thread
  • wireguard-go, default
  • Kernel WireGuard, default

Peak memoryMBLower is better

  • Our core, 1 thread3.5
  • boringtun, 1 thread5.3
  • wireguard-go, default34.8
  • Kernel WireGuard, defaultin-kernel, not separable

p99 latencymsLower is better

  • Our core, 1 thread0.94
  • boringtun, 1 thread1.15
  • wireguard-go, default1.39
  • Kernel WireGuard, default0.96

Each group has its own scale.

Peak memory and p99 latency on the same runs, 2026-08-31. Kernel WireGuard's memory is in-kernel and not separable.
Show the data
GroupSeriesValueRange
Peak memoryOur core, 1 thread3.5 MB
Peak memoryboringtun, 1 thread5.3 MB
Peak memorywireguard-go, default34.8 MB
Peak memoryKernel WireGuard, defaultin-kernel, not separable MB
p99 latencyOur core, 1 thread0.94 ms
p99 latencyboringtun, 1 thread1.15 ms
p99 latencywireguard-go, default1.39 ms
p99 latencyKernel WireGuard, default0.96 ms

CPU cost is where the laptop virtual machines earn their place in this post — it is the one axis the router results can't show, because a router's in-kernel comparator gives you no CPU breakdown to compare against.

  • Our core, 1 thread
  • boringtun, 1 thread
  • wireguard-go

Users/GbitWe lostLower is better

  • Our core, 1 thread0.347
  • boringtun, 1 thread0.290
  • wireguard-go0.876

Systems/GbitWe ledLower is better

  • Our core, 1 thread0.549
  • boringtun, 1 thread0.787
  • wireguard-go1.490

Totals/GbitWe ledLower is better

  • Our core, 1 thread0.90
  • boringtun, 1 thread1.08
  • wireguard-go2.37
CPU seconds per gigabit, user plus system time, three userspace cores, 2026-08-31. The split is where the next section's loss shows up.
Show the data
GroupSeriesValue, s/GbitRange
UserOur core, 1 thread0.347
Userboringtun, 1 thread0.290
Userwireguard-go0.876
SystemOur core, 1 thread0.549
Systemboringtun, 1 thread0.787
Systemwireguard-go1.490
TotalOur core, 1 thread0.90
Totalboringtun, 1 thread1.08
Totalwireguard-go2.37

Where we did not win

Three places, all explained rather than buried in the CSV:

Latency under load on Linux, 2026-10-30. On our x86_64 Linux virtual machines, Quantum's ping p99 under one TCP stream was higher than kernel WireGuard's and boringtun's (between two 2-vCPU VMs on one host, 4.72 ms against 2.27 and 1.83), though lower than wireguard-go's, and its CPU per gigabit missed our 2.5-times target against wireguard-go in 10 of 12 measurements. Throughput is no longer on this list for Linux: see the update below.

User-mode CPU, on the 2026-08-31 laptop virtual machines. 0.347 s/Gbit against the cheaper Rust comparator's 0.290 — the one place in the laptop results where that comparator is ahead of us. Our reading is that it's bought, not wasted: our core does TUN checksum offload in both directions, which moves work out of the kernel and into userspace CPU accounted as user time — and the system-CPU column, where that trade is repaid, is comfortably ahead (0.549 vs 0.787). Total CPU still wins. The user/sys split above is shown specifically so this trade is visible rather than asserted.

Round-trip time, on the router. 1.22 ms against the kernel tunnel's 0.92 ms — the one hardware axis where in-kernel wins outright, for the ordinary reason that our path costs a container's veth hop and a userspace scheduling turn that an in-kernel path doesn't pay. Interestingly the 2026-08-31 laptop virtual machines show the opposite ordering on p99 latency (0.94 ms vs the kernel's 0.96 ms) — we don't read anything into that beyond "different environments, different bottlenecks," and say so rather than picking whichever number flatters more.

Update, 2026-10-30: Linux virtual machines

The laptop virtual machines (2026-08-31) and the router run (2026-09-01) above are dated history; the routers were not re-measured. On 2026-10-30 we measured the Linux daemon, built from our source that day, on our x86_64 virtual machines: AMD Ryzen 7 8845HS hosts, Ubuntu 26.04.1, kernel 7.0, iperf3 3.20, one and four TCP streams, median of 5 runs.

  • We led 1.33–2.67 times against wireguard-go’s single-stream traffic Quantum with as many threads as vCPUs, on one VM with each side held to 1, 2 or 4 vCPUs
  • We led 1.35–1.79 times against wireguard-go’s single-stream traffic Quantum with as many threads as vCPUs, between two VMs on one host
  • Tie Tied against both at the link Quantum and wireguard-go over a 2.5 Gbit/s link
  • Mixed 10 of 12 against wireguard-go spent 1.7 to 2.6 times Quantum’s CPU per gigabit Measurements short of our 2.5-times CPU target
  • We lost 4.72 ms against 2.27 for kernel WireGuard Ping p99 under one TCP stream between two 2-vCPU VMs on one host, higher than kernel WireGuard’s

With as many threads as vCPUs (fv run --threads N; its default is 1; these are not the apps), Quantum carried 1.33 to 2.67 times wireguard-go's single-stream traffic on one VM with each side held to 1, 2 or 4 vCPUs, and 1.35 to 1.79 times between two VMs on one host; over a 2.5 Gbit/s link the two tied at the link. wireguard-go spent 1.7 to 2.6 times Quantum's CPU per gigabit above the no-tunnel baseline, with Quantum in whichever setting cost it less (mostly one thread), short of our 2.5-times target in 10 of 12 measurements, and Quantum's latency under load was higher than kernel WireGuard's.

Our earlier runs of 2026-10-16 and 2026-10-17, on Scaleway servers with the build before these changes, had kernel WireGuard and wireguard-go ahead by about two to three times; they stay on the compare page as the earlier build and are not compared with these. Method, spreads and every loss: the Linux benchmark and the virtual-machine run.

Which figures are fresh, and which are dated

Every figure above carries a date: the router figures are 2026-09-01, the laptop figures 2026-08-31. Both are history, measured on a tree from before a coordinated major-version bump of the crypto crates our data plane calls on every packet — chacha20poly1305, blake2, curve25519-dalek. The router figure also isn't pinned to a specific commit — read “2026-09-01” as “early September”. The current Linux measurement is the 2026-10-30 update above.

What we could re-run today, on this machine, without a router or virtual machines, is the part of the path the crypto bump touched most directly: encapsulate and decapsulate cost, isolated from every socket, TUN and threading concern above.

  • Our core
  • boringtun 0.7.1

Encapsulate, 64 BnsLower is better

  • Our core219.2
  • boringtun 0.7.1218.7

Encapsulate, 512 BnsLower is better

  • Our core436.4
  • boringtun 0.7.1442.5

Encapsulate, 1420 BnsLower is better

  • Our core938.1
  • boringtun 0.7.1968.3

Decapsulate, 64 BnsLower is better

  • Our core238.8
  • boringtun 0.7.1226.7

Decapsulate, 512 BnsLower is better

  • Our core562.1
  • boringtun 0.7.1539.2

Decapsulate, 1420 BnsLower is better

  • Our core1099.5
  • boringtun 0.7.11069.4
Encapsulate and decapsulate cost per packet, nanoseconds, 2026-09-05; mixed by direction and packet size, all within a few percent either way.
Show the data
GroupSeriesValue, nsRange
Encapsulate, 64 BOur core219.2
Encapsulate, 64 Bboringtun 0.7.1218.7
Encapsulate, 512 BOur core436.4
Encapsulate, 512 Bboringtun 0.7.1442.5
Encapsulate, 1420 BOur core938.1
Encapsulate, 1420 Bboringtun 0.7.1968.3
Decapsulate, 64 BOur core238.8
Decapsulate, 64 Bboringtun 0.7.1226.7
Decapsulate, 512 BOur core562.1
Decapsulate, 512 Bboringtun 0.7.1539.2
Decapsulate, 1420 BOur core1099.5
Decapsulate, 1420 Bboringtun 0.7.11069.4

Re-run 2026-09-05, Apple M3 Max, cargo bench -p forestvpn-quantum --bench datapath_benches -- --measurement-time 3 --warm-up-time 1, criterion 0.8.2, 100 samples per point. No socket, no TUN, no threads — one completed handshake, then encapsulate/decapsulate in a loop. Results are mixed by direction and packet size, all within a few percent either way, which is exactly what we'd expect: both cores seal and open every data packet with the same ChaCha20-Poly1305 code, from the ring crate. This is not a throughput claim — it says our crypto path costs about what boringtun's does, within noise, which is what makes the router wins above worth trusting: they come from elsewhere in the stack (syscall batching, offload, threading), not from a faster cipher.

Reproducing

task test:impls          # VMs: ours vs boringtun vs wireguard-go vs the kernel
task test:all            # VMs: single-hop, multi-hop, and the multihop cost table
cargo bench -p forestvpn-quantum --bench datapath_benches -- --measurement-time 3 --warm-up-time 1

The router run is manual today: fv in a RouterOS container on each box, against RouterOS's own WireGuard-protocol server.

Being straight about what that buys you: the harness and the raw results.csv behind every table here live in our tree, which is not public today. Read the commands above as an exact statement of what we ran, not as something you can clone and repeat. The claim least dependent on us is also the one most worth checking — boringtun and wireguard-go are public, iperf3 is public, and the thread-count trap at the top of this post (in the 2026-08-31 laptop virtual machines, one flag moving a comparator between roughly 789 and 1427 Mbit/s on a single host) is reproducible by anyone with those three and none of our code in the loop. If it holds up for you, the equalised rows above are the ones to argue with. If it doesn't, we want to hear about it.

All posts

Back to top

Ask us anything