Operations · November 18, 2026 · 7 min read

What decoding costs you in CPU, and how to measure it

There is no honest single number for how many cores a Solana decoder needs. There is a repeatable way to find yours: time each stage on recorded traffic, then size for the busiest slots.

Solana decoder CPU cost is set by your own traffic and code, so no published figure will fit your server. Measure it instead: replay recorded packets through each stage, time recovery, entry parsing, transaction parsing, lookup resolution, program decoding and writes separately, then size cores for the busiest slots you recorded, with headroom on top.

Where the work goes, stage by stage#

A decoder is a chain of stages, and each has its own cost profile:

  • Receive: reading datagrams from the socket. Mostly system call and copy work, proportional to packet count.
  • Recovery: rebuilding missing data shreds from coding shreds. Only runs when packets were lost, so its cost rises exactly when your network is having a bad moment.
  • Entry parsing: joining data shred payloads in order and reading entries out of them.
  • Transaction parsing: splitting entries into transactions and reading headers, keys and instructions.
  • Lookup resolution: turning v0 table indexes into addresses, cheap from a warm cache and slow when a table must be fetched.
  • Program decoding: reading instruction data for the programs you care about.
  • Writes: serialising rows and sending them to a queue or database.

Which stage dominates depends on what you keep. A pipeline that decodes every instruction of every program spends its time in the later stages. One that keeps a handful of programs spends it near the front.

Measuring each stage on your own traffic#

  1. Record real traffic to a capture file for a period that includes quiet and busy slots. Replaying a file makes every test run see the same input.
  2. Add a timer around each stage and export it as a histogram per stage, not one total. A total hides which stage grew.
  3. Replay the capture at its original pace first, and check that no stage falls behind. Then replay it as fast as the decoder will take it; the rate where a stage saturates one core is its ceiling.
  4. Profile the slowest stage with a sampling profiler such as perf, so you fix the function that costs most instead of the one you suspect.
  5. Benchmark tight inner functions, such as a transaction parser, with a statistics aware benchmark tool such as criterion, so small changes are not lost in noise.
  6. Repeat after each change to filters, language or data structures, and keep the results next to the commit that produced them.

What moves the bill: filters, language, allocation#

Where you filter. Dropping irrelevant transactions early is the largest saving available, because every later stage then sees less. Where to filter in a pipeline weighs the trade: the earlier the filter, the more it can miss.

Allocation. A parser that copies every key and instruction into fresh memory spends a surprising share of its time in the allocator. Borrowing views over the packet buffer avoids that; zero copy parsing shows how in Rust.

Language and layout. The language matters less than how stages are arranged. A comparison of decoder languages goes stage by stage, and decoder placement covers running decoding inside the bot or as its own service.

Lookup tables. A cold cache turns a cheap stage into network calls. Warm it before measuring, then measure a cold start separately.

Sizing for busy slots, not average ones#

Averages flatter a decoder. The slots that matter, such as a popular token launch or a liquidation wave, carry far more transactions than a quiet one, and a decoder that keeps up on average will queue and fall behind exactly then. Raw UDP does not wait for you: if the receive stage cannot drain the socket, packets are dropped and gone.

So size from the high percentiles of your recorded per slot work, not the mean. Keep the receive stage on its own core, so a slow decoder backs up into its queue instead of into the socket buffer. Then leave spare capacity, because the next busy period may be busier than the one you recorded.

A sizing worksheet to fill in#

StageTime per slot, typical (yours)Time per slot, busiest recorded (yours)Share of one core at the busiest (yours)Notes
ReceiveOwn core recommended
RecoveryRises with packet loss
Entry parsing
Transaction parsing
Lookup resolutionWarm and cold cache
Program decodingDepends on programs kept
WritesDepends on batch size
Total with headroom

The blanks are deliberate. Fill them from your own replays; the decoding pipeline describes each stage you are timing, and observability for decoders turns the same timers into production metrics.

What this method will not tell you#

A capture shows the traffic of the day you recorded it. Network upgrades, new programs and changes in market activity shift the mix, so re-run the measurement after big changes. Replays also skip the network itself: they test the decoder, not whether the receiving server drops packets under load. Check socket drop counters on the live machine for that.

Compiled instructions explains the format the parsing stage reads. When you are ready to record your own traffic, see the plans and prices.

Sources#

Raw shreds on your own server

Ultra Low Latency Shreds is $200 and Standard Shreds is $100. You pay in crypto, tell us which IPv4 address and UDP port should receive the stream, and we wire it up by hand.

Read nextZero copy parsing for Solana transactions